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?
- vaquita50 asked 11 years ago
- You must login to post comments
Hi there,
You could consider using of SciChartSurface.SeriesSource instead. It allows you to bind to an ObservableCollection which marries one DataSeries with one RenderableSeries, and in this case the DataSet creation is implicit (done internally by SciChart). Please, take a look at Databinding annotations with MVVM tutorial for an example of series creation via SeriesSource.
Also there is the tutorial How to add/remove series dynamically, which shows how to achieve this using the DataSet/RenderableSeries, and you can find corresponding example in our example suite Add/remove data series.
Hope this helps, please, feel free to ask if you have more questions!
Best regards,
Yuriy
- Yuriy Zadereckiy answered 11 years ago
-
Hi Yuriy. I tried to implement it using the examples on the links that you provided. But I am getting the following error ("The calling thread must be STA, because many UI components require this." and I cannot understand because I am doing exactly the same thing as in the examples. .XAML
<sciChart:SciChartSurface x:Name="SciChartSurface" Padding="0 0 0 30" Margin="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MouseLeftButtonDown="OnSciChartMouseLeftButtonDown" SeriesSource="{Binding SeriesSource}" sciChart:ThemeManager.Theme="Chrome"> <!-- Declare Axes --> <sciChart:SciChartSurface.XAxis> <sciChart:DateTimeAxis x:Name="XAxisData" AxisTitle="{x:Static prop:Resources.time}" VerticalAlignment="Top" Margin="0" Padding="0" FontSize="10" TitleFontSize="10" VisibleRange="{Binding SharedXVisibleRange, Mode=TwoWay}" DrawMajorGridLines="True" DrawMinorGridLines="True" TextFormatting="HH:mm MMM dd" SubDayTextFormatting="HH:mm:ss MMM dd"> <sciChart:DateTimeAxis.GrowBy> <sciChart:DoubleRange Min="0.1" Max="0.1"/> </sciChart:DateTimeAxis.GrowBy> </sciChart:DateTimeAxis> </sciChart:SciChartSurface.XAxis> <sciChart:SciChartSurface.YAxes> <sciChart:NumericAxis Name="YAxisData" Id="Left1" Margin="0" Padding="0" AxisAlignment="Left" FontSize="10" TitleFontSize="10" Width="50" AxisTitle="{Binding ChartModel.YaxisName}" MinorDelta="0" AutoRange="True"> <sciChart:NumericAxis.GrowBy> <sciChart:DoubleRange Min="0.1" Max="0.1"/> </sciChart:NumericAxis.GrowBy> </sciChart:NumericAxis> <sciChart:NumericAxis Id="Right1" Margin="0" Padding="0" AxisAlignment="Right" FontSize="10" TitleFontSize="10" AxisTitle="{Binding RightYaxisName}" MinorDelta="0" AutoRange="True"> <sciChart:NumericAxis.GrowBy> <sciChart:DoubleRange Min="0.1" Max="0.1"/> </sciChart:NumericAxis.GrowBy> </sciChart:NumericAxis> </sciChart:SciChartSurface.YAxes> <!-- Declare ChartModifiers --> <sciChart:SciChartSurface.ChartModifier> <sciChart:ModifierGroup Margin="0" Padding="0" FontSize="8" sciChart:MouseManager.MouseEventGroup="myCustomGroup"> <sciChart:LegendModifier x:Name="LegendModifier" GetLegendDataFor="AllSeries"/> <sciChart:RubberBandXyZoomModifier IsEnabled="True" IsXAxisOnly="True" ReceiveHandledEvents="True" /> <sciChart:ZoomPanModifier IsEnabled="False"/> <sciChart:MouseWheelZoomModifier IsEnabled="False"/> <sciChart:RolloverModifier IsEnabled="True" ReceiveHandledEvents="True"/> <sciChart:CursorModifier ReceiveHandledEvents="True" ShowTooltip="False" ShowAxisLabels="True"/> <sciChart:YAxisDragModifier YAxisId="Right1"/> <sciChart:YAxisDragModifier YAxisId="Left1"/> <sciChart:XAxisDragModifier/> <sciChart:ZoomExtentsModifier ExecuteOn="MouseRightButton"/> </sciChart:ModifierGroup> </sciChart:SciChartSurface.ChartModifier> <sciChart:SciChartSurface.Annotations> <sciChart:VerticalLineAnnotation YAxisId="Left1" X1="{Binding ScanRange.StartScan.Date, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Stretch" Stroke="DimGray" StrokeThickness="2" /> <sciChart:VerticalLineAnnotation YAxisId="Left1" X1="{Binding ScanRange.EndScan.Date, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Stretch" Stroke="Blue" StrokeThickness="2" /> </sciChart:SciChartSurface.Annotations> </sciChart:SciChartSurface>
ViewModel.CSprivate static readonly PropertyChangedEventArgs SeriesSourceChangeArgs = ObservableHelper.CreateArgs<AnalysisVelocityChartViewModel>(x => x.SeriesSource); private ObservableCollection<IChartSeriesViewModel> _seriesSource; public ObservableCollection<IChartSeriesViewModel> SeriesSource { get { return _seriesSource; } set { _seriesSource = value; NotifyPropertyChanged(SeriesSourceChangeArgs); } } private void LoadVelocityChartViewModel() { // Create a dataset on the ChartViewModel ChartData = new DataSeriesSet<DateTime, double>(); var renderableSeries = new FastLineRenderableSeries(); foreach (var chartDataModel in _chartModel.ChartDataModels) { var dataSeries = ChartData.AddSeries(); dataSeries.SeriesName = chartDataModel.SeriesName; dataSeries.Append(chartDataModel.ChartData.Keys, chartDataModel.ChartData.Values); renderableSeries.SeriesColor = GetRandomColor(); var vm = new ChartSeriesViewModel(dataSeries, renderableSeries); SeriesSource.Add(vm); } RightYaxisName = ChartSeriesName.VelocityDeformation; NotifyPropertyChanged(ChartModelChangeArgs); }
Thanks so much, I will really appreciate your help. Sandra -
Hi Sandra, Sorry, cannot tell you how to fix it without looking in the code. Generally, you need to check if all your methods can be called in the UI thread. Consider using BackgroundWorker and Dispatcher.Invoke() for those calls which can't be called. Best regards, Yuriy
- You must login to post comments
Please login first to submit.