0

I have data which is not very distintive like below so:

{time: 1617235200, value: 0.9999999999999999}
{time: 1617238800, value: 1}
{time: 1617242400, value: 1}
{time: 1617246000, value: 1}
{time: 1617249600, value: 0.9999999999999999}
{time: 1617253200, value: 0.9999999999999998}
{time: 1617256800, value: 1.0000000000000002}
{time: 1617260400, value: 1.0000000000000002}
{time: 1617264000, value: 1}
{time: 1617267600, value: 1}
{time: 1617271200, value: 1}
{time: 1617274800, value: 1}
{time: 1617278400, value: 1}
{time: 1617282000, value: 1}
{time: 1617285600, value: 1}
{time: 1617289200, value: 1}
{time: 1617292800, value: 0.9999999999999998}
{time: 1617321600, value: 1.0000000000000002}
{time: 1617325200, value: 1}
{time: 1617328800, value: 1}
{time: 1617332400, value: 1}
{time: 1617336000, value: 1}
{time: 1617339600, value: 1}

Once I have made a chart it does show the x-axis, times.

However, y-axis is not visible(weird behavior, say I set y-axis on the right and moving to the right by dragging long enough than the whole length of the chart, sometimes it shows, like it's hidden without dragging-very first look but exists the edge of the right chart box but sometims it does not even work.)

I'm assumming that values cause this issue as other charts use more dramatic values and make charts with no problem(both x and y are visible fine).

I also Pretty much played with createChart but not too sure if I am missing some so please take a look(I guess it should be fine tough, as I said other charts with distintive data are fine).

// parameter for createChart()
{
 width: 1410,
      height: 758,
      localization: {
        locale: "ja-JP",
      },
      layout: {
        backgroundColor: "rgba(33, 33, 33, 1)",
        textColor: "rgba(255, 255, 255, 0.9)",
      },
      grid: {
        vertLines: {
          color: "rgba(45, 45, 45, 1)",
        },
        horzLines: {
          color: "rgba(45, 45, 45, 1)",
        },
      },
      rightPriceScale: {
        scaleMargins: {
          top: 0.2,
          bottom: 0.1,
        },
      },
      priceScale: {
        position: "right",
        mode: PriceScaleMode.Normal,
        autoScale: true,
        invertScale: false,
        alignLabels: false,
        borderVisible: false,
        scaleMargins: {
          top: 0.1,
          bottom: 0.1,
        },
      },
      crosshair: {
        vertLine: {
          color: "#6A5ACD",
          width: 1,
          style: 1,
          visible: true,
          labelVisible: true,
        },
        horzLine: {
          color: "#6A5ACD",
          width: 0.5,
          style: 1,
          visible: true,
          labelVisible: true,
        },
        // mode: 0,
        mode: CrosshairMode.Normal,
      },

      timeScale: {
        timeVisible: true,
        secondsVisible: true,
      },
}

How can I get y-axis when chart got not distintive data(if it's the problem).

Thanks in advance.

hoho azuma
  • 23
  • 4
  • What price format did you set when you create a series? https://github.com/tradingview/lightweight-charts/blob/master/docs/series-basics.md#price-format – timocov May 11 '21 at 11:06
  • @timocov the parameter above does not contain `priceFormat` tough, I actually tried it but it seemed like not working when I set precision: 16, and minMove: 0.0000000000000001 as some values 16 decimal places - I'm not too sure I set it correctly and the capabilities of options; `precision`, `minMove`. – hoho azuma May 12 '21 at 01:53
  • By default it uses only 2 decimal places and you need to provide proper price format for a series. Can you share your try in jsfiddle and so I can help you with that. – timocov Jun 06 '21 at 22:12

0 Answers0