gwatts / jquery.sparkline

A plugin for the jQuery javascript library to generate small sparkline charts directly in the browser
http://omnipotent.net/jquery.sparkline/
1.24k stars 278 forks source link

tooltip is reversibly displayed with values #201

Closed cimfalab closed 6 years ago

cimfalab commented 6 years ago

I have a simple bar chart. It is displayed in the order 1, 2, 3, 4, 5, 6. But when I hover to show tooltip, it displays exact reversed value. For example, I hover on the bar with 6, the tooltip displays 1. image

What was I missing?

        var impacts = [1,2,3,4,5,6];
        var sparklineLogin = function () {
            $('#sparklinedash').sparkline(impacts, {
                type: 'bar',
                barWidth: '4',
                height: '30',
                resize: true,
                barSpacing: '5',
                colorMap: ['#ff4747', '#ffcf4c', '#1fcc7d'],
                chartRangeMin: 0
            });
        }
cimfalab commented 6 years ago

Sorry for confusing. I used the array 'impacts' also in Chartist. And the array seems to be reversed after the creation of Chartist.Bar. So I cloned the array and passed it to Chartist. Now the tooltip works correctly.

A bit shame to me.