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

Add ChartMarkedZone to bar chart based on data

1 Answer 45 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 17 Feb 2012, 10:26 PM
I have a query that is returning TotalSubmissions, AcceptedSubmissions, RejectedSubmissions and PendingSubmissions.  These are drawn as four bars on a bar chart.  I want to add two ChartMarkedZones to the chart, one at 10% of the TotalSubmissions and one at 60% of TotalSubmissions.  How do I go about this?

Thomas

1 Answer, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 20 Feb 2012, 05:14 PM
Hello Thomas,

The mark zones are static objects (they cannot be bound to expression that depend on data) and as such you will have to programmatically create them. You have to get the item TotalSubmissions and calculate where to draw the marked zones. The zones themselves are created like this:

chart1.PlotArea.MarkedZones.Add(new Charting.ChartMarkedZone { ValueStartY = 1, ValueEndY = 2 });

Start and End Y value will tell where the mark zone will be placed.  All the best,
Elian
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
General Discussions
Asked by
Thomas
Top achievements
Rank 1
Answers by
Elian
Telerik team
Share this question
or