This is a migrated thread and some comments may be shown as answers.

Duplicate XCategory values in line chart

4 Answers 68 Views
Chart
This is a migrated thread and some comments may be shown as answers.
accacc
Top achievements
Rank 1
accacc asked on 10 Oct 2013, 08:31 AM
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?

4 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 15 Oct 2013, 01:00 PM
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 >>
0
accacc
Top achievements
Rank 1
answered on 16 Oct 2013, 08:36 AM
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.
0
accacc
Top achievements
Rank 1
answered on 21 Oct 2013, 09:12 AM
please help!!!
0
Tina Stancheva
Telerik team
answered on 21 Oct 2013, 12:56 PM
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 >>
Tags
Chart
Asked by
accacc
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
accacc
Top achievements
Rank 1
Share this question
or