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?
- Gang Xu asked 2 years ago
- last edited 2 years ago
-
This might be a bug. VisibleRange 0,10 is a default range but we should be handling it. Let me check with the team and revert back to you
-
Good to know. Thanks.
-
Update: we have a workaround for the VisibleRange = (0,10) issue here. https://www.scichart.com/questions/js/visible-range-not-working-as-expected
- You must login to post comments
Another question. My data is longer than preset visible range. I’d like the chart can zoom in and out on x axis, and can return back to original scale (the visible range before zooming started by mouse wheel) with a double-clicking. For example, the visible x axis range was 0-10 at the very beginning. I dragged the chart to 2-12. And I zoomed in to see details. Finally I double-click to return to the original scale which is 10 seconds long. The final x range should be 2-12, instead of 0-10.
Is there a way to achieve that? I read the documentation and didn’t fully understand how the property zoomExtentsToInitialRange works.
https://www.scichart.com/documentation/js/current/webframe.html#ZoomExtentsModifier.html
please advise. Many thanks.
- Gang Xu answered 2 years ago
- You must login to post comments
Hi Gang,
In order to zoom back to original scale after panning and zooming in for details we need a chart modifier. Right now in SciChart.js we do not have a chart modifier that does exactly what you need. However, it is quite easy to create a custom one.
This is an example how to create a custom MouseWheelZoomModifier which does exactly what you need
import {
IMouseWheelZoomModifierOptions,
MouseWheelZoomModifier
} from 'scichart/Charting/ChartModifiers/MouseWheelZoomModifier';
import { ModifierMouseArgs } from 'scichart/Charting/ChartModifiers/ModifierMouseArgs';
import { easing, TEasingFn } from 'scichart/Core/Animations/EasingFunctions';
import { NumberRange } from 'scichart/Core/NumberRange';
export class CustomMouseWheelZoomModifier extends MouseWheelZoomModifier {
protected isExtendsRangeSet: boolean = false;
constructor(options?: IMouseWheelZoomModifierOptions) {
super(options);
}
public modifierMouseWheel(args: ModifierMouseArgs): void {
console.log('modifierMouseWheel');
if (!this.isExtendsRangeSet) {
this.parentSurface.xAxes.asArray().forEach(xAxis => {
xAxis.zoomExtentsRange = new NumberRange(xAxis.visibleRange.min, xAxis.visibleRange.max);
console.log('xAxis.zoomExtentsRange', xAxis.zoomExtentsRange.min, xAxis.zoomExtentsRange.max);
});
this.isExtendsRangeSet = true;
}
super.modifierMouseWheel(args);
}
public modifierDoubleClick(args: ModifierMouseArgs) {
console.log('modifierDoubleClick');
if (this.isExtendsRangeSet) {
const animationDuration = 500;
const easingFunction: TEasingFn = easing.outExpo;
this.parentSurface.zoomExtentsX(animationDuration, easingFunction);
this.isExtendsRangeSet = false;
}
}
}
You will find the full working Zoom Extends to Original Scale Demo here
Best regards,
Michael
- Michael Klishevich answered 2 years ago
- last edited 2 years ago
-
awesome, thanks.
- You must login to post comments
Please login first to submit.