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

Horizontal Bars with DateTime on (visual) X-Axis

3 Answers 93 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lukas
Top achievements
Rank 1
Lukas asked on 04 Aug 2010, 09:02 AM
I'm searching for a solution for the following type of chart:
1. The (visual!) X-Axis shows DateTime (a History)
2. The Y-Axis show one or more different groups
3. Each Group shows (Stacked) Bars in different colors related to a global Legend

I found a Chart Type HorizontalStackBar which seams to be as close as possible to my requirement. There the configured X-Axis is the visual Y-Axis and vice versa. (BTW: This is quite confusing...) To get DateTime on an Axis there is the Property IsDateTime. But this is only available on the X-Axis Element, which is here the visual Y-Axis.
Further I tried to change the DefaulLabelFormat to format my values as DateTime, but this seems not to be supported.

Is there any other solution for my requirement?

Thanks,
Lukas

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 09 Aug 2010, 12:55 PM
Hi Lukas,

Currently RadChart does not support DateTime values along the Y axis, which is generally used to represent numeric values. This is also why using DefaultLabelFormat to format your values would not work.

One possible work-around would be setting manually the Y-Axis labels by editing the strings, so that they would represent DateTime values and also setting manually the X-Axis range, in such a manner that it would fit the data that is to be displayed. Say, setting the axis range from 1 to 100, where each unit represents one day.

Greetings,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Lukas
Top achievements
Rank 1
answered on 09 Aug 2010, 01:08 PM
> One possible work-around would be setting manually the Y-Axis labels by editing the strings...
Is there any example how to do this? For me this souds like a work-around.
Is there any plan to extend the Chart by such a feature? Should I create a PITS entry for this? Are you using it (even currently called "BETA")?

Thanks,
Lukas
0
Nikolay
Telerik team
answered on 11 Aug 2010, 12:34 PM
Hello Lukas,

Introducing DateTime support on the Y-Axis is currently not in our plans.

As for setting custom strings as labels along the axis, it can be achieved in the following manner :
this.RadChart1.DefaultView.ChartArea.AxisY.RangeChanged += new EventHandler(AxisY_RangeChanged);
void AxisY_RangeChanged(object sender, EventArgs e)
        {
            string[] months = new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
            for (int i = 0; i < months.Length; i++)
            {
                RadChart1.DefaultView.ChartArea.AxisY.TickPoints[i].Label = months[i];
            }
        }

Please, note that the AutoRange property should be set to false and the manually added range has to have as much or more tick points as the size of your collection of strings.For more information, please, have a look at this help topic.

Hope this helps.

Kind regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Lukas
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Lukas
Top achievements
Rank 1
Share this question
or