SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

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>
Version
6.x
  • Hasdrubal Barca
    Unfortunately, it doesn’t help, I have changed the style applied to the style property of NumericAxis but it doesn’t help also, steel have no axes drawn.
  • You must to post comments
0
0

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’

WPF Chart Modify Axis Properties

enter image description here

Let me know if this helps

Best regards,
Andrew

  • You must to post comments
0
0

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>
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.