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

Background regions for BarSeries

1 Answer 91 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 12 Aug 2015, 11:40 AM

Hello, i need to do background regions for BarSeries, i just made a visualization(in attachment)

My code in this moment looks like:

<telerik:RadCartesianChart BorderThickness="1">
    <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="Y"/>
    </telerik:RadCartesianChart.Grid>
    <telerik:RadCartesianChart.Behaviors>
        <telerik:ChartPanAndZoomBehavior/>
    </telerik:RadCartesianChart.Behaviors>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:DateTimeCategoricalAxis GapLength="0.2" x:Name="HorizontalAxis" LabelFitMode="MultiLine" LabelFormat="dd-MM-yyyy HH:mm"/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis/>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:BarSeries ValueBinding ="Glucose" CategoryBinding="Date" ItemsSource="{Binding BloodGlucoseList}">
            <telerik:BarSeries.PointTemplate>
                <DataTemplate>
                    <Rectangle Fill="{Binding DataItem.ChartColor}" MaxWidth="100"/>
                </DataTemplate>
            </telerik:BarSeries.PointTemplate >
        </telerik:BarSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

 How can i archive my goal?

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 17 Aug 2015, 07:43 AM
Hello Adam,

I see that you have managed to get the background of the bars working, so I assume that you are talking about the background that is behind the bars (for example, the orange bars have their specific background). Let me know if this is not the region you are talking about.

You can use a CartesianPlotBandAnnotation for each region you need. In short you need to create the annotations, set the Axis, From and To properties.

Regards,
Petar Marchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ChartView
Asked by
Adam
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or