Scale breaks questions

Thread is closed for posting
5 posts, 1 answers
  1. john
    john avatar
    32 posts
    Member since:
    Nov 2010

    Posted 04 Apr 2011 Link to this post

    Hi,

    I'm evaluating the RadChart control and I have some questions about scale breaks:

    - Is it possible to set the height of the different segments? For example: I'm using four segments. When I display the four segments the area for each segment is the same (height for each segment is about total height/4), but when I display three or two segments the height of one segment is bigger than the rest. I would like the height segments to be the same in all the cases.
    (I've attached some screenshots for this example).

    - Is it possible to set the Y-Axis labels for each segment with a different appearance (for example text color)?

    - Is it possible to set a different background color for each segment?

    Thanks in advance.
    John.
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 07 Apr 2011 Link to this post

    Hello john,

    Onto your questions:

    • You can manually define the axis segments if you want precise control over the different ranges:
    ChartSeries series = new ChartSeries();
    series.Type = ChartSeriesType.Line;
    series.AddItem(0.25);
    series.AddItem(1);
    series.AddItem(0.75);
     
    RadChart1.Series.Add(series);
     
    ChartSeries series2 = new ChartSeries();
    series2.Type = ChartSeriesType.Line;
    series2.AddItem(4);
    series2.AddItem(18);
    series2.AddItem(11);
     
    RadChart1.Series.Add(series2);
     
    ChartSeries series3 = new ChartSeries();
    series3.Type = ChartSeriesType.Line;
    series3.AddItem(61);
    series3.AddItem(67);
    series3.AddItem(65);
     
    RadChart1.Series.Add(series3);
     
    ChartSeries series4 = new ChartSeries();
    series4.Type = ChartSeriesType.Line;
    series4.AddItem(217);
    series4.AddItem(228);
    series4.AddItem(220);
     
    RadChart1.Series.Add(series4);
     
    RadChart1.PlotArea.YAxis.AutoScale = false;
    RadChart1.PlotArea.YAxis.ScaleBreaks.Enabled = true;
     
    RadChart1.PlotArea.YAxis.ScaleBreaks.Segments.Add(new AxisSegment() { MinValue = 0, MaxValue = 1, Step = 0.25 });
    RadChart1.PlotArea.YAxis.ScaleBreaks.Segments.Add(new AxisSegment() { MinValue = 4, MaxValue = 18, Step = 3.5 });
    RadChart1.PlotArea.YAxis.ScaleBreaks.Segments.Add(new AxisSegment() { MinValue = 61, MaxValue = 70, Step = 2.25 });
    RadChart1.PlotArea.YAxis.ScaleBreaks.Segments.Add(new AxisSegment() { MinValue = 217, MaxValue = 228, Step = 2.75 });
    • Unfortunately it is not possible to set different styling for the axis segments.
    • You can use the marked zones functionality to define different background for each axis segment:
    var markedZone = new ChartMarkedZone() { ValueStartY = 0, ValueEndY = 1 };
    markedZone.Appearance.FillStyle.MainColor = Color.Salmon;
    var markedZone2 = new ChartMarkedZone() { ValueStartY = 4, ValueEndY = 18 };
    markedZone2.Appearance.FillStyle.MainColor = Color.Red;
    var markedZone3 = new ChartMarkedZone() { ValueStartY = 61, ValueEndY = 70 };
    markedZone3.Appearance.FillStyle.MainColor = Color.Yellow;
    var markedZone4 = new ChartMarkedZone() { ValueStartY = 217, ValueEndY = 228 };
    markedZone4.Appearance.FillStyle.MainColor = Color.Green;
     
    RadChart1.PlotArea.MarkedZones.Add(markedZone);
    RadChart1.PlotArea.MarkedZones.Add(markedZone2);
    RadChart1.PlotArea.MarkedZones.Add(markedZone3);
    RadChart1.PlotArea.MarkedZones.Add(markedZone4);

    Hope this helps.

    Greetings,
    Giuseppe
    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
  3. john
    john avatar
    32 posts
    Member since:
    Nov 2010

    Posted 07 Apr 2011 Link to this post

    Thanks for your response, Giuseppe.

    I'm defining the segments manually in a similar way you propose in your response (I'm using the min/max values of the series), but the result is what I show in the attached screenshots. My question is about to set the height in pixels for each segment, so when there are less than 4 segments all of them have the same height (height of each segment in pixels = total height in pixels / number of segments). Is that possible or the height of each segment is calculated automatically?

    About the different background color for each segment, I will try using marked zones as you suggest.

    Regards,
    John.
  4. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 08 Apr 2011 Link to this post

    Hello john,

    Sorry for the misunderstanding.

    Unfortunately RadChart does not provide support for manually setting pixel height for the axis segments so it would not be possible to achieve the desired appearance.


    All the best,
    Giuseppe
    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
  5. john
    john avatar
    32 posts
    Member since:
    Nov 2010

    Posted 09 Apr 2011 Link to this post

    Ok, thanks for your help.
    John.
Back to Top