Hi,
We are not able to reproduce the issue. Can you please provide us the full code to create the above chart?
Regards,
Shoaib
Thanks a lot...
All of the code shown as below:
1. XAML <vc:Chart Theme="Theme1" View3D="False" Height="378" Width="1100" LightingEnabled="False" Background="#FFF5F5DF" Name="SLChart" UniqueColors="False">
<vc:Chart.Titles>
<vc:Title Text="用电线路故障统计" FontColor="#000000" FontSize="20"/>
</vc:Chart.Titles>
<vc:Chart.AxesY>
<vc:Axis LineColor="#000000"
LineThickness="1"
Title="故障数量"
Enabled="True"
StartFromZero="True"
AxisType="Primary"
LineStyle="Solid">
<my:Axis.AxisLabels>
<my:AxisLabels FontSize="13" />
</my:Axis.AxisLabels>
</vc:Axis>
</vc:Chart.AxesY>
<vc:Chart.AxesX>
<vc:Axis LineColor="#000000"
Interval="1"
LineThickness="1"
Title="时间(Hour)"
Enabled="True"
AxisType="Primary"
LineStyle="Solid"
StartFromZero="True"
>
<my:Axis.AxisLabels>
<my:AxisLabels FontSize="13" />
</my:Axis.AxisLabels>
</vc:Axis>
</vc:Chart.AxesX>
<vc:Chart.Series>
<vc:DataSeries RenderAs="Line" AxisYType="Primary" LegendText="故障数量" >
</vc:DataSeries>
</vc:Chart.Series>
</vc:Chart>
2.".cs" public void ChartDataBind(string DpDay)
{
string weburl = Application.Current.Host.Source.ToString();
weburl = weburl.Substring(0, (weburl.Length - 23)) + "/ChartsService.svc";
MyChartsService.ChartsServiceClient client = new MyChartsService.ChartsServiceClient("CustomBinding_ChartsService1", weburl);
client.GetWarnCountDatasAsync(DpDay);
client.GetWarnCountDatasCompleted += new EventHandler<MyChartsService.GetWarnCountDatasCompletedEventArgs>(client_GetWarnCountDatasCompleted);
}
void client_GetWarnCountDatasCompleted(object sender, MyChartsService.GetWarnCountDatasCompletedEventArgs e)
{
ObservableCollection<MyChartsService.WarnCount> datas = e.Result;
DataMapping dm1 = new DataMapping();
dm1.MemberName = "AxisXLabel";
dm1.Path = "DpHour";
SLChart.Series[0].DataMappings.Add(dm1);
DataMapping dm2 = new DataMapping();
dm2.MemberName = "YValue";
dm2.Path = "DpSumQty";
SLChart.Series[0].DataMappings.Add(dm2);
SLChart.Series[0].DataSource = e.Result;
}
Thanks again.