Pre loader

SeriesInfo get axis title

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

Answered
0
0

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support-dev.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

  • You must to post comments
Best Answer
1
0

Hi Marcel,

Please try out this solution – uses MultiBinding and ValueConverter, looks for AxisTitle using DataSeries.SeriesName, so you still need to set it, but to any value you want.

Put this inside the DataTemplate:

                        <TextBlock Grid.Row="0"
                                   Grid.Column="4"
                                   Margin="3,3,3,3"
                                   FontSize="10"
                                   FontWeight="Bold"
                                   Foreground="{Binding SeriesColor,
                                                        Converter={StaticResource ColorToBrushConverter}}">
                            <TextBlock.Text>
                                <MultiBinding Converter="{StaticResource SeriesNameToAxisTitleConverter}" Mode="OneTime">
                                    <Binding Path="SeriesName" />
                                    <Binding ElementName="sciChart" Path="." />
                                </MultiBinding>
                            </TextBlock.Text>
                        </TextBlock>

ValueConverter code:

    public class SeriesNameToAxisTitleConverter: IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            var seriesName = (string)values[0];
            var sciChartSurface = (ISciChartSurface)values[1];

            var currentSeries =
                sciChartSurface.RenderableSeries.SingleOrDefault(series => series.DataSeries.SeriesName == seriesName);

            var yAxisId = currentSeries.YAxisId;
            var axisTitle = sciChartSurface.YAxes.Single(axis => axis.Id == yAxisId).AxisTitle;

            return axisTitle;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

Is this a suitable way to achieve what do you want?

Best regards,
Yuriy

  • Marcel
    Hello Yuriy, yes it is suitable, thank you very much! Have a nice day!
  • You must to post comments
0
0

I solved this problem by binding to SeriesName and set this before with the name for the YAxis, but surely there is a better way

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