hello,
i am trying to set up a custom range on my y axis as our 'date' values are custom generated and do not work in the same way as normal dates or numeric values.
we have a situation where the chart would run along variable time levels, ie sometimes weeks, sometimes months, quarters, etc. the chart needs to plot these time members across the Y axis of a horizontal 2D Bar chart and display the values as such:
M201010 M201011 M201012 M201101 etc..
what we did to overcome the fact that we need a numeric value for the axis was to use only the numeric section of the chart and then set a min and max value (since we know the start and end date for the chart) but this works only as long as the values are for the same year, in this example 2010.
if the periods span over 2 years, ie from 2010 to 2011, the series stretches from M201012 all the way to M201099 before getting on to 2011, because it increments by one of course.
the chart is set up in the xaml as follows:
is there a way to get around this?
thanks,
Nemanja
i am trying to set up a custom range on my y axis as our 'date' values are custom generated and do not work in the same way as normal dates or numeric values.
we have a situation where the chart would run along variable time levels, ie sometimes weeks, sometimes months, quarters, etc. the chart needs to plot these time members across the Y axis of a horizontal 2D Bar chart and display the values as such:
M201010 M201011 M201012 M201101 etc..
what we did to overcome the fact that we need a numeric value for the axis was to use only the numeric section of the chart and then set a min and max value (since we know the start and end date for the chart) but this works only as long as the values are for the same year, in this example 2010.
if the periods span over 2 years, ie from 2010 to 2011, the series stretches from M201012 all the way to M201099 before getting on to 2011, because it increments by one of course.
the chart is set up in the xaml as follows:
<
telerik:RadChart
Grid.Row
=
"0"
Grid.Column
=
"0"
x:Name
=
"TimeRangeChart"
ItemsSource
=
"{Binding PhasingOptionList}"
UseDefaultLayout
=
"False"
DataBound
=
"TimeRangeChart_Loaded"
>
<
telerik:RadChart.Resources
>
<
Style
x:Key
=
"CustomAxisTitleStyle"
TargetType
=
"telerik:AxisTitle"
>
<
Setter
Property
=
"FontWeight"
Value
=
"Normal"
/>
<
Setter
Property
=
"Margin"
Value
=
"0,0,10,0"
/>
</
Style
>
<
Style
x:Key
=
"SeriesItemLabelStyle"
TargetType
=
"telerik:SeriesItemLabel"
>
<
Setter
Property
=
"VerticalAlignment"
Value
=
"Center"
/>
</
Style
>
<
Style
x:Key
=
"ItemLabelStyle"
TargetType
=
"TextBlock"
>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Left"
/>
<
Setter
Property
=
"Visibility"
Value
=
"Collapsed"
/>
</
Style
>
</
telerik:RadChart.Resources
>
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMapping
ChartAreaName
=
"ChartArea"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:HorizontalRangeBarSeriesDefinition
ShowItemLabels
=
"True"
ItemLabelFormat
=
"#OptionName - #ColourDescr"
ShowItemToolTips
=
"True"
SeriesItemLabelStyle
=
"{StaticResource SeriesItemLabelStyle}"
>
<
telerik:HorizontalRangeBarSeriesDefinition.InteractivitySettings
>
<
telerik:InteractivitySettings
SelectionMode
=
"Single"
SelectionScope
=
"Item"
HoverScope
=
"Item"
/>
</
telerik:HorizontalRangeBarSeriesDefinition.InteractivitySettings
>
</
telerik:HorizontalRangeBarSeriesDefinition
>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:ItemMapping
FieldName
=
"ProposedSellTimeFromCodeNumeric"
DataPointMember
=
"Low"
/>
<
telerik:ItemMapping
FieldName
=
"ProposedSellTimeToCodeNumeric"
DataPointMember
=
"High"
/>
<
telerik:ItemMapping
FieldName
=
"OptionNo"
DataPointMember
=
"XCategory"
/>
</
telerik:SeriesMapping
>
</
telerik:RadChart.SeriesMappings
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
telerik:ChartArea
Grid.Row
=
"0"
x:Name
=
"ChartArea"
NoDataString
=
""
LabelFormatBehavior
=
"None"
ItemClick
=
"ChartArea_ItemClick"
ItemToolTipOpening
=
"ChartArea_ItemToolTipOpening"
PaletteBrushesRepeat
=
"False"
EnableAnimations
=
"False"
>
<
telerik:ChartArea.ZoomScrollSettingsX
>
<
telerik:ZoomScrollSettings
ScrollMode
=
"ScrollAndZoom"
MinZoomRange
=
"0.005"
/>
</
telerik:ChartArea.ZoomScrollSettingsX
>
<
telerik:ChartArea.PaletteBrushes
>
<
SolidColorBrush
Color
=
"#FF74A6E2"
/>
</
telerik:ChartArea.PaletteBrushes
>
<
telerik:ChartArea.AxisY
>
<
telerik:AxisY
Title
=
"{Binding BottomTimePeriodDescription}"
ExtendDirection
=
"Up"
DefaultLabelFormat
=
"{Binding TimeValueLabelFormat}"
MinValue
=
"{Binding FromWeekNumeric}"
MaxValue
=
"{Binding ToWeekNumeric}"
AutoRange
=
"False"
LabelRotationAngle
=
"-45"
MinorTicksVisibility
=
"Hidden"
>
<
telerik:AxisY.AxisStyles
>
<
telerik:AxisStyles
TitleStyle
=
"{StaticResource CustomAxisTitleStyle}"
ItemLabelStyle
=
"{StaticResource ChartAxisTextStyle}"
/>
</
telerik:AxisY.AxisStyles
>
</
telerik:AxisY
>
</
telerik:ChartArea.AxisY
>
<
telerik:ChartArea.AxisX
>
<
telerik:AxisX
LayoutMode
=
"Inside"
MinorTicksVisibility
=
"Collapsed"
MajorTicksVisibility
=
"Collapsed"
>
<
telerik:AxisX.AxisStyles
>
<
telerik:AxisStyles
ItemLabelStyle
=
"{StaticResource ItemLabelStyle}"
/>
</
telerik:AxisX.AxisStyles
>
</
telerik:AxisX
>
</
telerik:ChartArea.AxisX
>
</
telerik:ChartArea
>
</
Grid
>
</
telerik:RadChart
>
is there a way to get around this?
thanks,
Nemanja