none
Axis type as Data in C#? RRS feed

  • Question

  • Hello everybody.

    I created Line Chart in Excel 2010 with two serieses of data with common X [Horizontal] axis as a Percentage. It plots the chart but it's a little mess there, but when right click the % axis >Format and choose Type as Data, it fixes the chart and it's all good, my question is how can i do that effect [Type as Data {Rather than Text or Auto}] programatically using C# ? I check the Axis properties and .Type have xlValues / xlCategory and xlSeriesAxis but nothing like the UI options of Auto / Text / Data.

     Which is what i need and it's good, Maybe helps 2 mention, that one series is longer in rows than the other, as implied on the first chart, but they both are on the same percentage scale.. All i need is to choose the that Date property for the Axis Format via C#... 

    *I am using Excel 2010 14.0.7 x64




    • Moved by CoolDadTx Monday, October 27, 2014 5:54 PM Office related
    • Edited by YakirCohen Friday, October 31, 2014 1:53 AM
    Monday, October 27, 2014 4:12 PM

Answers

  • Hi YakirCohen,

    Thanks for posting in MSDN forum.

    Based on the description, you want to format the type of Axis Type. The type of Axis corresponds to XlCategoryType enumeration. And based on the secnario, its value is xlTimeScale.

    In addition, to get the similar code corresponds user operation, we can use recrod macros.

    Hope it is hlepful.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by YakirCohen Tuesday, October 28, 2014 10:11 PM
    Tuesday, October 28, 2014 8:07 AM
    Moderator
  • Hi YarkirCohen,

    Thanks for your detail information. As far as I know, there is no specific row and column information in a normal exception, that's the reaseon I asked you which exception you are handling.

    And based on my understanding, we sholud use more specific Exception type to hand the exceptlion, since we have a specific understanding of why the exception was thrown, and can implement a specific recovery, such as catching a FileNotFoundExceptionobject and prompting the user to enter a new file name.(refer to Exception Handling)

    Would you mind sharing with us the code in Catch block to help us to understand the secnario exactly?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by YakirCohen Friday, October 31, 2014 1:55 AM
    Thursday, October 30, 2014 1:24 AM
    Moderator
  • Hi YakirCohen,

    If the exception class is provide by .Net Framework, I think it is hard to get the column information.

    The VSTO also provide the specfic exception, since you don't metion the exception exactly I am not able to sure whether there is way to get the specific column information about it.

    However you can get all assembly from link below:

    Managed Reference

    You can check whether there is a property provide the information for it based on the exception type.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 31, 2014 1:42 AM
    Moderator

All replies

  • Hi YakirCohen,

    Thanks for posting in MSDN forum.

    Based on the description, you want to format the type of Axis Type. The type of Axis corresponds to XlCategoryType enumeration. And based on the secnario, its value is xlTimeScale.

    In addition, to get the similar code corresponds user operation, we can use recrod macros.

    Hope it is hlepful.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by YakirCohen Tuesday, October 28, 2014 10:11 PM
    Tuesday, October 28, 2014 8:07 AM
    Moderator
  • Yeh finally that's the thing..  thank you very much.. Struggling this annoying fly for few days couldn't find an Answer anywhere..

    Maybe you can help me with this also, As sometimes i am stacking few code rows into fewer rows, to make it more encapsulated, and i have Try Catch block with Exception detailing, but it as usual always show the only the row number of where the Exception is, is there anyway to make it show also the Column of the row of the exception? That was also one of the bumpers on my code..

    Thanks again and have a great day..
    Tuesday, October 28, 2014 10:23 PM
  • Hi YakirCohen,

    What's kind of Exception you are handling? Would you mind share some code snippet with to help us understand the issue exactly?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 29, 2014 8:28 AM
    Moderator
  • Hello Fei.. theres many methods and functions that i use the TCB so its not a specific issue just geneal question.. its just regular try catch block where the catch(Exception Ex) is detailed and elaborated and some are also Stack Traced..

    • Edited by YakirCohen Wednesday, October 29, 2014 8:47 AM
    Wednesday, October 29, 2014 8:41 AM
  • Hi YarkirCohen,

    Thanks for your detail information. As far as I know, there is no specific row and column information in a normal exception, that's the reaseon I asked you which exception you are handling.

    And based on my understanding, we sholud use more specific Exception type to hand the exceptlion, since we have a specific understanding of why the exception was thrown, and can implement a specific recovery, such as catching a FileNotFoundExceptionobject and prompting the user to enter a new file name.(refer to Exception Handling)

    Would you mind sharing with us the code in Catch block to help us to understand the secnario exactly?

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by YakirCohen Friday, October 31, 2014 1:55 AM
    Thursday, October 30, 2014 1:24 AM
    Moderator
  • Hello Fei.. There's no specific Exception i encountered with, it's more like a general question, so there's no Ex type that i cab give you, but i know however, that when i encounter exception it always giving me the Line of which the Exception occurred, it's the actual Exception object, like Catch(Exception Ex1){ Ex1.ToString(); } or Ex1.TargetSite.ToString() but it always gives me the Line.. So i was thinking it'll sometimes be nice to have the actual Col for the thing.. But never mind if there's no way to get that, it's not a big deal really.. Thanks for your help and have a great day...

    Thursday, October 30, 2014 7:07 PM
  • Hi YakirCohen,

    If the exception class is provide by .Net Framework, I think it is hard to get the column information.

    The VSTO also provide the specfic exception, since you don't metion the exception exactly I am not able to sure whether there is way to get the specific column information about it.

    However you can get all assembly from link below:

    Managed Reference

    You can check whether there is a property provide the information for it based on the exception type.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 31, 2014 1:42 AM
    Moderator
  • Okay i see.. Thank you very much and have a great day...
    Friday, October 31, 2014 1:55 AM