I am building an application that requires toggling between Linear and Logarithmic scales. The application is doing realtime socket streaming. Curious if anyone had any recommendations on how best to implement this functionality? I see it exists as part of the WPF library but not currently supported for the Javascript version.
Logarithmic Scale for Javascript Scichart
92 Views Asked by James Miller At
2
There are 2 best solutions below
0

Update for you, Logarithmic Axis is now supported. You can check out an example here: https://www.scichart.com/example/javascript-chart/javascript-chart-logarithmic-axis/
How to add a Logarithmic Axis to a SciChartSurface in JavaScript:
import { SciChartSurface } from "scichart";
import { LogarithmicAxis } from "scichart/Charting/Visuals/Axis/LogarithmicAxis";
import { ENumericFormat } from "scichart/types/NumericFormat";
// Create a SciChartSurface
const { sciChartSurface, wasmContext } = await SciChartSurface.create(divElementId);
// Create an X Axis
const xAxisLogarithmic = new LogarithmicAxis(wasmContext, {
logBase: 10,
labelFormat: ENumericFormat.Scientific,
labelPrecision: 2,
minorsPerMajor: 10
});
sciChartSurface.xAxes.add(xAxisLogarithmic);
Full source code for the demo is here on Github. Documentation is here
Logarithmic Axis is supported by SciChart WPF, iOS and Android, but not on JavaScript yet.
It is on the roadmap as several users have requested it. Will be delivering an update soon!