Logarithmic Scale for Javascript Scichart

92 Views Asked by At

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.

2

There are 2 best solutions below

0
On

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!

0
On

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/ SciChart Logarithmic Axis Demo

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 GithubDocumentation is here