Hi there,
I am new to the SciChart. Could you please tell me what is the name of “x-Axis” in SciStockChart?
Since from your example, you used SciChartSurface. The Checkbox syntax shows below. The ElementName is xAxis.
CheckBox Margin=”3″ Content=”Draw Major Gridlines” IsChecked=”{Binding ElementName=xAxis, Path=DrawMajorGridLines, Mode=TwoWay}”/>
… …
s:SciChartSurface.XAxis>
s:DateTimeAxis x:Name=”xAxis” VisibleRangeChanged=”OnXVisibleRangeChanged”>
/s:SciChartSurface.XAxis>
But I can not find or change the name property in SciStockChart. Could you please tell me what ElementName should I use? Or if there are other ways to achieve this. Thank you very much!
- Dexin Wang asked 6 years ago
- last edited 6 years ago
- You must login to post comments
Hi Dexin,
The SciStockChart inherits SciChartSurface and adds some defaults for stock chart developers.
To access the XAxis (which is declared internally) and change properties, you do so via the SciStockChart.XAxisStyle property. Have a look here for a code sample.
Let me know if this helps!
Best regards,
Andrew
- Andrew Burnett-Thompson answered 6 years ago
-
Thank you for your reply! I have seen this sample many times and I know how to change the property in XAxisStyle. I just wanted to know when I use a checkbox, how to bind the “checkbox” to “DrawMajorGridLines” in SciStockChart. Thank you! And your kid is very cute.
-
Bind from style setter to the checkbox or to a property in the view model. e.g. <Setter Property=”DrawMajorGridLines” Value=”{Binding ElementName=myCheckBox, Path=IsChecked, Mode=TwoWay}”/>
-
Hi Andrew, Thank you for your reply! Here I first name the checkbox “myCheckBox” and then bind “DrawMajorGridLines” to “myCheckBox” through setter property like what you said. But it still does not work. The Gridlines are always there. Could you please tell me the reason? Thank you! BTW, we have your license.
-
Thank you Andrew, I solved it in C#.
- You must login to post comments
Hi Andrew, Thank you for your reply! Here I first name the checkbox “myCheckBox” at left side toolbar and then bind “DrawMajorGridLines” to “myCheckBox” through setter property like what you said. But it still does not work. The Gridlines are always there. Could you please tell me the reason? Thank you!
<ext:FlyoutMenuButton HorizontalAlignment="Left" Content="XAxis Controls" Padding="0" Style="{StaticResource FlyoutMenuButtonStyle}" ToolTipService.ToolTip="XAxis Controls">
<ext:FlyoutMenuButton.PopupContent>
<StackPanel MinWidth="150" Orientation="Vertical">
<TextBlock Text="XAxis Controls"/>
<CheckBox x:Name="myCheckBox" Margin="3" Content="Draw Major Gridlines" IsChecked="True" />
</StackPanel>
</ext:FlyoutMenuButton.PopupContent>
</ext:FlyoutMenuButton>
<s:SciStockChart.XAxisStyle>
<Style TargetType="s:CategoryDateTimeAxis">
<Setter Property="DrawMajorGridLines" Value="{Binding ElementName=myCheckBox, Path=IsChecked, Mode=TwoWay}" />
</Style>
</s:SciStockChart.XAxisStyle>
- Dexin Wang answered 6 years ago
- You must login to post comments
Please login first to submit.