lightningchart

Add timestamp to image generated by SavetoFile

≯℡__Kan透↙ 提交于 2020-08-10 19:13:29
问题 Hi I was checking out the docs of chartXY of LightningChartJs and couldn't seem to find a way to add a timestamp to the image saved by saveToFile. Thanks in advance. 回答1: LightningChart JS saveToFile doesn't support adding a timestamp. You can achieve this by implementing your own saving. The steps to do this is: Get reference to the canvas LightningChart JS is running in. const chartCanvas = chart.engine.container.querySelector('canvas') Convert the canvas content to a data url with

Show custom tick in X-axis on Hover

耗尽温柔 提交于 2020-06-29 03:59:26
问题 I am adding custom ticks and custom labels using below code axisX3.addCustomTick() .setGridStrokeLength(0) .setTextFormatter(()=> ttstr[0]+":"+ttstr[1]) .setValue(xVal); atleast = 0; spotseries3.setResultTableFormatter((builder, series, xValue, yValue) => { return builder .addRow('Straddle - IV') .addRow(yValue.toFixed(2)) .addRow(timdata[xValue.toFixed(0)]) }) Please see above screenshot, I have few questions: You can see when I mouse hover, its showing 602 in x-axis. How to show custom tick

How to show custom label in line chart or scatter chart

巧了我就是萌 提交于 2020-06-17 12:54:07
问题 I am adding data to charts like this const data = [ ["2020-05-22 14:20:22", "173.9"], ["2020-05-22 14:20:40", "175.3"], ["2020-05-22 14:20:58", "172.4"] ] function stringToDate(s) { s = s.split(/[-: ]/); return new Date(s[0], s[1]-1, s[2], s[3], s[4], s[5]); } for(var key in data) { var xTime = stringToDate(data[key][0]); var yVal = parseFloat(data[key][1]); series.add({ x: xTime.getTime() - dateOrigin.getTime(), y: yVal}) } How do I show custom label to it, For example I want to show full

How to disable animations for charts in LightningChart JS?

半城伤御伤魂 提交于 2020-02-25 22:00:26
问题 I want to disable the animations that are on in the charts in LightningChart JS. How can I do that? 回答1: Disabling animations depends on which animations you want to disable. To disable axis scrolling animation you can use: axis.setAnimationScroll(undefined) setAnimationScroll For xy chart axis zooming axis.setAnimationZoom(undefined) setAnimationZoom For Funnel, Pyramid, Spider, Pie and Gauge charts. chart.setAnimationsEnabled(false) 来源: https://stackoverflow.com/questions/57370680/how-to

Changing axis label color in LightningChart JS

五迷三道 提交于 2020-01-11 11:26:24
问题 The chart appears with dark background, axis numeric labels in grid positions are yellow. How do I change axis label colors to white? E.g. in this example https://www.arction.com/lightningchart-js-interactive-examples/#edit/lcjs_example_0001_simpleScatter I'm trying chart.getDefaultAxisX() .setInterval(0, 92 * dataFrequency) .setTickStyle((visibleTicks) => visibleTicks .setLabelFillStyle( color: ColorRGBA(255, 255, 255) }) ) But it's giving SyntaxError: Unexpected token, expected "," 回答1: