Hi,
Im having issues trying to get the scrolling working on my chart.
What Im trying to achieve:
I would like 10 points in view at a time
What Im getting:
I can make the scrollbar appear but it doesnt do anything
Background:
I am binding to the chart and grouping on a company code
my code:
Commented out sections are things i have tried after looking at the help
any suggestions?
Im having issues trying to get the scrolling working on my chart.
What Im trying to achieve:
I would like 10 points in view at a time
What Im getting:
I can make the scrollbar appear but it doesnt do anything
Background:
I am binding to the chart and grouping on a company code
my code:
Commented out sections are things i have tried after looking at the help
private
void
Charting()
{
RankChart.ItemsSource =
null
;
RankChart.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollOnly;
RankChart.DefaultView.ChartArea.ZoomScrollSettingsX.MinZoomRange = 0.001;
//RankChart.DefaultView.ChartArea.ZoomScrollSettingsX.RangeStart = 0.4;
//RankChart.DefaultView.ChartArea.ZoomScrollSettingsX.RangeEnd = 1;
//RankChart.DefaultView.ChartArea.ZoomScrollSettingsX.SetSelectionRange(0.4, 1);
RankChart.DefaultView.ChartArea.AxisX.StepLabelLevelCount = 1;
RankChart.SeriesMappings.Clear();
RankChart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 90;
RankChart.DefaultView.ChartArea.AdditionalYAxes.Clear();
RankChart.DefaultView.ChartArea.AdditionalYAxes.Add(
new
AxisY());
RankChart.DefaultView.ChartArea.AdditionalYAxes[0].AxisName =
"Secondary"
;
RankChart.DefaultView.ChartArea.AdditionalYAxes[0].DefaultLabelFormat =
"#VAL{p2}"
;
RankChart.DefaultView.ChartArea.AxisX.AutoRange =
false
;
RankChart.DefaultView.ChartArea.EnableAnimations =
false
;
RankChart.SamplingSettings.SamplingFunction = ChartSamplingFunction.First;
ScatterSeriesDefinition def2 =
new
ScatterSeriesDefinition();
def2.AxisName =
"Secondary"
;
def2.LegendDisplayMode = LegendDisplayMode.None;
def2.ItemLabelFormat =
"#VAL{p}"
;
def2.ItemToolTipFormat =
"#VAL{p}"
;
def2.ShowItemLabels =
true
;
this
.AddSeries(def2,
"GrowthPCT"
);
BarSeriesDefinition def1 =
new
BarSeriesDefinition();
def1.InteractivitySettings.HoverScope = InteractivityScope.Item;
def1.ShowItemLabels =
false
;
def1.ShowItemToolTips =
true
;
def1.ItemToolTipFormat =
"Sales: #VAL{C4}"
;
this
.AddSeries(def1,
"YTDSales"
);
RankChart.DefaultView.ChartLegendPosition = Telerik.Windows.Controls.Dock.Bottom;
RankChart.ItemsSource =
this
.DataContext;
}
private
void
AddSeries(ISeriesDefinition definition,
string
fieldName)
{
SeriesMapping s =
new
SeriesMapping();
s.SeriesDefinition = definition;
s.GroupingSettings.GroupDescriptors.Add(
new
ChartGroupDescriptor(
"Code"
));
s.ItemMappings.Add(
new
ItemMapping(
"Code"
, DataPointMember.XCategory));
s.ItemMappings.Add(
new
ItemMapping(fieldName, DataPointMember.YValue));
RankChart.SeriesMappings.Add(s);
}
any suggestions?