Duplicate XCategory values in line chart

5 posts, 0 answers
  1. accacc
    accacc avatar
    5 posts
    Member since:
    Jun 2011

    Posted 10 Oct 2013 Link to this post

    I've got the following data:

        X      Y
        23:00  1
        23:00  2
        23:01  3
        23:01  4
        23:01  5
        23:02  6
        23:02  5

    etc

    Now I want to show them in Line Chart, so that X is X axis, and Y is Y.
    A set the XCategory to X and YValue to Y.
    However, I only see the distinct values of X, like

        23:00 0
        23:01 3
        23:02 6

    How do I "ungroup" them?

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 15 Oct 2013 Link to this post

    Hello,

    I can see that you've submitted this ticket under the RadChart control section. However, we have included a newer charting component in our suite and it might be easier for you to use it instead. You can find more information about the differences between the two components here.

    When you use the RadChartView component, if you define a HorizontalAxis of type DateTimeCategoricalAxis - then the X values will be grouped based on the DateTimeComponent value - basically by Year, Month, Date, Hour, Seconds. This is why in your case a better option would be to use the DateTimeContinuousAxis. Then you can define the MajorStepUnit which gets or sets the unit that defines the custom major step of the axis and you can also define a value (through the MajorStep property) of the step between two adjacent ticks on the axis.

    You can also use the ChartDataSource to additionally sample the plotted data.

    I attached a sample solution to demonstrate my suggestions. Please have a look at it and let me know if it helps or if we're missing anything from your requirements.

    Regards,
    Tina Stancheva
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. accacc
    accacc avatar
    5 posts
    Member since:
    Jun 2011

    Posted 16 Oct 2013 Link to this post

    Hello,

    i am using Telerik.Windows.Controls.Charting.dll, v2012.2.1015.1050 version.for your solution,sould i get the last version?

    and i need sometimes this for only date,xCategory is as string,something like names etc.

    please look attachments.
  5. accacc
    accacc avatar
    5 posts
    Member since:
    Jun 2011

    Posted 21 Oct 2013 Link to this post

    please help!!!
  6. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 21 Oct 2013 Link to this post

    Hi,

    Please accept my apology for the delayed response.

    If you're using the Charting.dll this means that you're using the old RadChart control. We usually recommend upgrading to the RadChartView control for all new development tasks as the new version is improved in terms of performance and implementation. Also, if you can upgdare to our latest version, you will be able to take full advantage of our latest features and fixes.

    However, with both controls - RadChart and RadChartView, it is not recommended to display the same value multiple times in the axis. This is due to the fact that generally in a charting component, when a categorical axis displays recurrent values, the plotted data is less readable. Basically to be complete and meaningful, quantitative information consists of both quantitative data - the numbers—and categorical data —the labels that tell us what the numbers measure. This is why the categories that convey the meaning of the data points have to be unique and if you provide a Chart with data that doesn't consist of unique categorical values, then the component will group the data accordingly and it will only display the unique values in its categorical axis.

    This means that in your case, where you need to display string values in the X-axis, you can't display all entries as ticks unless you change them to be unique. For instance, you can add spaces in the values of your X-axis properties so that they can display the same string but be considered as unique values by the charting component.

    Regards,
    Tina Stancheva
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner