Pre loader

Editable Chart Titles and Axis Titles?

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

I can’t seem to find it in the API, but I figured I’d ask .Is any built in support for live editing the Chart Title or Axis Titles right on the chart surface like you can with a TextAnnotation?

  • You must to post comments
0
0

No, there isn’t I’m afraid, however I have a workaround for you.

Editing Chart Titles

The Chart Title is shown in a TextBlock on the chart and Textblock.Text is bound to SciChartSurface.ChartTitle property.

What I would suggest you do is show some UI over the top of the chart to edit the chart title, then set the title of SciChartSurface.ChartTitle after editing.

I know this is lame but unfortunately this part cannot be customised in the current UI.

Editing Axis Titles

These parts are templatable, so you can swap out an Axis title for any UI.

Please take a look at Styling Axis Labels, Axis Titles, Rotating Axis Labels which has a complete walk through how to style the chart parts.

In particular,

How to Template the Axis Title
To insert a custom Control into the Axis Title, you can use this code.

<Style x:Key="BottomAxisTitleStyle" TargetType="s:AxisTitle">
    <Setter Property="ContentTemplate">
        <Setter.Value>
            <DataTemplate>
                <StackPanel>
                    <TextBlock Margin="0,3,0,0" Style="{StaticResource TitleTextStyle}" Text="Showing time on"/>
                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding}"/>
                    <TextBlock Margin="0,0,0,3" Style="{StaticResource TitleTextStyle}" Text="(daily Timeframe)"/>
                </StackPanel>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>
 
<s:DateTimeAxis TitleStyle="{StaticResource BottomAxisTitleStyle}" />

Using this API you could change the Axis TitleStyle and control template to any UI, swapping it for a TextBlock with a TextBox over the top of it.

Hope this helps,
Andrew

  • patrick milinazzo
    Has templating been added to the chart title part since this post?
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies