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

Zoom posibilities without seriesmappings?

3 Answers 80 Views
Chart
This is a migrated thread and some comments may be shown as answers.
m v klingeren
Top achievements
Rank 1
m v klingeren asked on 14 Jul 2010, 09:16 AM
I've created a barchart using DataSeries to which i add DataPoint's, it shows 6 months with on the X-axis
with 2bars for each months - it displays a value in euro's on the Y-axis

< see attachment >

When i add zoom settings to this chart, it doesnt seem to have effect

           
//ZoomScrollSettings zoomSettings = new ZoomScrollSettings();<br>           
//zoomSettings.MinZoomRange = 0.3;<br>           
//zoomSettings.RangeEnd = 1.0;<br>           
//zoomSettings.RangeStart = 0.5;<br>           
//zoomSettings.ScrollMode = ScrollMode.ScrollOnly;<br><br>
//this.RadChart2.DefaultView.ChartArea.ZoomScrollSettingsX = zoomSettings;<br>


My question is, how do i make the bars top to the full height of the chart?

3 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 15 Jul 2010, 04:29 PM
Hi m v klingeren,

Unfortunately zooming & scrolling is available in databound scenarios only so it will not be possible to achieve the desired effect. We will update the help article here to indicate this information as soon as possible as well.


Sincerely yours,
Freddie
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
Ricardo
Top achievements
Rank 1
answered on 04 Aug 2010, 08:32 PM

I'm using SeriesMapping for a particular set of data. And for another collection, that is different from the first, I'm using DataSeries. The idea is to show both data in the same chart. I did it, how you can see in the image attached (the lines have been done with SeriesMapping and the boxes with DataSeries).

But, the DataSeries don't work properly with zoom. A possible solution would be binding the data in DataSeries, but it's a kind of data very different from the one that's is already bound. There is a way to do zoom work with DataSeries? Do you have any idea of how to fix this problem?

I did notice that if I plot the DataSeries when chart is with zoom, the data is ploted nicely. In this case, a solution could be refresh the plotted area every time that zoom is applied or updated. There is a way to do it?

0
Giuseppe
Telerik team
answered on 09 Aug 2010, 02:09 PM
Hi Ricardo,

As we noted previously zooming & scrolling is supported only for charts in databound mode and generally we would strongly discourage you to mix databound and non-databound series within a single chart as this is not designed and supported behavior as well.

As for detecting zoom/scroll action -- ChartArea.ZoomScrollSettingsX / ZoomScrollSettingsY are both implementing INotifyPropertyChanged, so you can handle the PropertyChanged event to achieve the desired effect (take a look at this example -- in it we are subscribing to the PropertyChanged event and are changing the XAxis format strings to match the appropriate zoom range).

The code in question is:
Copy Code
RadChart1.DefaultView.ChartArea.ZoomScrollSettingsX.PropertyChanged += ZoomScrollSettingsX_PropertyChanged;
and
Copy Code
private void ZoomScrollSettingsX_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
    double range = (sender as ZoomScrollSettings).Range;
 
    if (range > 0.7d)
    {
        RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "yyyy";
        RadChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 1;
    }
    else if (range > 1d / 12d)
    {
        RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "MMMM yyyy";
        RadChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 2;
    }
    else if (range > 1d / 12d / 30d)
    {
        RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "dd MMM yyyy";
        RadChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 2;
    }
    else
    {
        RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "dd-MMM (HH:mm)";
        RadChart1.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 2;
    }
}

Hope this helps.


Greetings,
Freddie
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
m v klingeren
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Ricardo
Top achievements
Rank 1
Share this question
or