Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Y-axis shows invalid tooltip when reversed #3827

Labels
bug Something isn't working

Comments

@AndriyBogdan
Copy link

Description

The Y-axis shows invalid values on tooltip when it became reversed - it still show non-reversed values

Steps to Reproduce

Expected Behavior

The Y-axis tooltip shows reverted values if the axis was reverted

Actual Behavior

The Y-axis tooltip does not show reverted values if the axis was reverted - it still showing a non-reverted values

Screenshots

image

Reproduction Link

@AndriyBogdan AndriyBogdan added the bug Something isn't working label May 11, 2023
@brianlagunas
Copy link
Member

Required repro link not provided

@AndriyBogdan
Copy link
Author

Required repro link not provided

What the link? You can use any of line chart witrh any type of data and makle it reversed by Y-axis and look at Y-axis tooltip value. Many of examples from codepen, you need to add only reversed: true
It is ridiculous

var options = {
      chart: {
        type: "area",
        height: 300,
        foreColor: "#999",
        stacked: true,
        dropShadow: {
          enabled: true,
          enabledSeries: [0],
          top: -2,
          left: 2,
          blur: 5,
          opacity: 0.06
        }
      },
      colors: ['#00E396', '#0090FF'],
      stroke: {
        curve: "smooth",
        width: 3
      },
      dataLabels: {
        enabled: false
      },
      series: [{
        name: 'Total Views',
        data: generateDayWiseTimeSeries(0, 18)
      }, {
        name: 'Unique Views',
        data: generateDayWiseTimeSeries(1, 18)
      }],
      markers: {
        size: 0,
        strokeColor: "#fff",
        strokeWidth: 3,
        strokeOpacity: 1,
        fillOpacity: 1,
        hover: {
          size: 6
        }
      },
      xaxis: {
        type: "datetime",
        axisBorder: {
          show: false
        },
        axisTicks: {
          show: false
        }
      },
      yaxis: {
        labels: {
          offsetX: 14,
          offsetY: -5
        },
        reversed: true,
        tooltip: {
          enabled: true
        }
      },
      grid: {
        padding: {
          left: -5,
          right: 5
        }
      },
      tooltip: {
        x: {
          format: "dd MMM yyyy"
        },
      },
      legend: {
        position: 'top',
        horizontalAlign: 'left'
      },
      fill: {
        type: "solid",
        fillOpacity: 0.7
      }
    };

    var chart = new ApexCharts(document.querySelector("#timeline-chart"), options);

    chart.render();

    function generateDayWiseTimeSeries(s, count) {
      var values = [[
        4,3,10,9,29,19,25,9,12,7,19,5,13,9,17,2,7,5
      ], [
        2,3,8,7,22,16,23,7,11,5,12,5,10,4,15,2,6,2
      ]];
      var i = 0;
      var series = [];
      var x = new Date("11 Nov 2012").getTime();
      while (i < count) {
        series.push([x, values[s][i]]);
        x += 86400000;
        i++;
      }
      return series;
    }

@AndriyBogdan
Copy link
Author

image

@AndriyBogdan
Copy link
Author

@AndriyBogdan
Copy link
Author

zooming of Y-axis is not working correctly too - it still zoom like an non-reversed and shows area after zooming that is not selected. It is confused and make analazing of chart with huge set of points more harder

@brianlagunas
Copy link
Member

Thank you for providing a reproduction link.

@brianlagunas brianlagunas reopened this May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment