1.how to draw Axis x parallel Lines
2.the Label font slant 45
3.background
Here is my wrong xaml code:
<igWebChart:XamWebChart HorizontalAlignment="Left" Name="xamWebChart1" VerticalAlignment="Top"> <igWebChart:XamWebChart.Legend> <igWebChart:Legend Visibility="Collapsed"> </igWebChart:Legend> </igWebChart:XamWebChart.Legend> <igWebChart:XamWebChart.Axes> <igWebChart:Axis AxisType="PrimaryX"> <igWebChart:Axis.MajorGridline> <igWebChart:GridlineGroup Visibility="Visible"> </igWebChart:GridlineGroup> </igWebChart:Axis.MajorGridline> <igWebChart:Axis.Label> <igWebChart:LabelGroup AutoResize="True"></igWebChart:LabelGroup> </igWebChart:Axis.Label> </igWebChart:Axis> <igWebChart:Axis AxisType="PrimaryY" Unit="2" > <igWebChart:Axis.DataContext> <DataTemplate> <Line> <Line.Fill> <SolidColorBrush Color="Black"></SolidColorBrush> </Line.Fill> </Line> </DataTemplate> </igWebChart:Axis.DataContext> </igWebChart:Axis> </igWebChart:XamWebChart.Axes>
<!--<igWebChart:XamWebChart.Scene> <igWebChart:Scene> <igWebChart:Scene.GridArea> <igWebChart:GridArea> <igWebChart:GridArea.Template> <ControlTemplate TargetType="igWebChart:GridArea"> <Grid> <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Border Background="Red" Grid.Row="0" BorderThickness="2" BorderBrush="Black" /> <Border Background="Yellow" Grid.Row="1" BorderThickness="2" BorderBrush="Black"/> <Border Background="Lime" Grid.Row="2" BorderThickness="2" BorderBrush="Black"/> <Border Background="Lime" Grid.Row="3" BorderThickness="2" BorderBrush="Black" /> <Border Background="Yellow" Grid.Row="4" BorderThickness="2" BorderBrush="Black"/> <Border Background="Red" Grid.Row="5" BorderThickness="2" BorderBrush="Black" /> </Grid> <ContentPresenter/> </Grid> </ControlTemplate> </igWebChart:GridArea.Template> </igWebChart:GridArea> </igWebChart:Scene.GridArea> </igWebChart:Scene> </igWebChart:XamWebChart.Scene>-->
<igWebChart:XamWebChart.Series> <igWebChart:Series ChartType="Line"> <igWebChart:Series.Marker> <igWebChart:Marker Format="" Type="Circle" ></igWebChart:Marker> </igWebChart:Series.Marker> <igWebChart:Series.DataPoints> <igWebChart:DataPoint Value="12" Label="a" /> <igWebChart:DataPoint Value="34" Label="b"/> <igWebChart:DataPoint Value="56" Label="c"/> <igWebChart:DataPoint Value="25" Label="d"/> <igWebChart:DataPoint Value="56" Label="e"/> <igWebChart:DataPoint Value="81" Label="f"/> </igWebChart:Series.DataPoints> </igWebChart:Series> </igWebChart:XamWebChart.Series> </igWebChart:XamWebChart>
Rendering :
Thanks! so i have to convert datasource .⊙︿⊙
The stroke pattern is set using StrokeDashArray, which is a native silverlight object. You can create various patterns that aren't necessarily dotted. Here's the article explaining StrokeDashArray:http://msdn.microsoft.com/en-us/library/system.windows.shapes.shape.strokedasharray(v=vs.95).aspx
There is no way to explicitly declare axis type. It will adapt to the series.ChartType property. If you have a Line chart, x axis will be either of type string, or DateTime, so your datasource should have a string or a date time column. Based on your previous screenshots, I'm not seeing how your data source contains numeric values for the x axis. Can you provide more detail on what your data source looks like, what column types it has and what output you're trying to see.
my datasourse was Numeric
ok! solve this problem, the parallel line was not fixed and it was dotted line.
by the way , how to set the XAxis as Numeric .
This would be much easier to do in XAML, because it requires re-templating the gridlines. Or at least, create the style in XAML and assign it in code-behind.
<igWebChart:Axis AxisType="PrimaryY"> <igWebChart:Axis.MajorGridline> <igWebChart:GridlineGroup> <igWebChart:GridlineGroup.GridlineStyle> <Style TargetType="igWebChart:Mark"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="igWebChart:Mark"> <Rectangle Stroke="LightGray" StrokeThickness="1" StrokeDashArray="5 1"/> </ControlTemplate> </Setter.Value> </Setter> </Style> </igWebChart:GridlineGroup.GridlineStyle> </igWebChart:GridlineGroup> </igWebChart:Axis.MajorGridline></igWebChart:Axis>
Also, since it seems you are using a Silverlight chart, please post on the Silverlight forum, as these are the WPF forums. Thanks.