SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hi,
I’m actually working on new wpf application using Scichart and I’m wondering how to plot only XAxis and YAxis without labels and without gridlines.
Here is my code, I cannot not figure out what is missing to do that:
<s:SciChartSurface.YAxis>
<s:NumericAxis VisibleRange="{Binding ...}"
MajorGridLineStyle="{Binding ...}"
TickLabelStyle="{Binding ...}"
MajorDelta="{Binding ...}"
MinorDelta="1"
AutoTicks="False"
AxisAlignment="Left"
DrawMajorGridLines="false
DrawMinorGridLines="false"
DrawMajorBands="false"
DrawMajorTicks="false"
DrawMinorTicks="false"
DrawLabels="false"
</s:SciChartSurface.YAxis>
<Style x:Key="NoGraphGridLineStyle" TargetType="s:NumericAxis">
<Setter Property="Visibility" Value="Collapsed" />
</Style>
Hi there ,
Setting properties on Axis:
DrawMajorGridLines="false"
DrawMinorGridLines="false"
DrawMajorBands="false"
DrawMajorTicks="false"
DrawMinorTicks="false"
DrawLabels="false"
is exactly how to disable gridlines and labels. We demonstrate this in our example ‘Modify Axis Behaviour’
Let me know if this helps
Best regards,
Andrew
Play around with something like the following… I use a separate SciChart.xaml file to store all my ChartSurface styles and reference it from my app.xaml as a merged resource. Then you can just reference it as a style (I’m sure you already understand that part).
<s:SciChartSurface.XAxis>
<s:NumericAxis x:Name="BottomAxis" AutoRange="{Binding Path=XAutoRange}"
FlipCoordinates="False"
GrowBy="0.05, 0.05"
ScientificNotation="None"
s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
s:CursorModifier.AxisLabelTemplate="{StaticResource MyCursorXAxisLabelTemplate}"
Style="{DynamicResource ResourceKey=MyXaxisStyle}" />
</s:SciChartSurface.XAxis>
<Style x:Key="MyXaxisStyle" TargetType="s:AxisBase">
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="FontSize" Value="12" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="TickTextBrush" Value="Gray"/>
<Setter Property="DrawMajorBands" Value="False"/>
<Setter Property="DrawMajorGridLines" Value="False" />
<Setter Property="DrawMinorGridLines" Value="False" />
<Setter Property="AxisBandsFill" Value="White"/>
<Setter Property="MinorTickLineStyle">
<Setter.Value>
<Style TargetType="Line">
<Setter Property="Stroke" Value="Gray"/>
<Setter Property="StrokeThickness" Value="1"/>
<Setter Property="X2" Value="4"/>
<Setter Property="Y2" Value="4"/>
</Style>
</Setter.Value>
</Setter>
</Style>
Please login first to submit.