C3: Tooltips in reverse order

Created on 8 Jul 2017  路  2Comments  路  Source: c3js/c3

See this thread from news group
https://groups.google.com/forum/#!searchin/c3js/tooltip$20reverse%7Csort:relevance/c3js/OGP3FXYlOxo/HGAPt9LNh7sJ

This happens for me with stacked bars when I set 'order' to null. Setting order to null makes both the graph and the tooltiop respect the order of the input, but the tooltip shows the elements in the reverse order of the stacked graph

I am using versions:
C3: 0.4.14
D3: 3.5.17

C-bug

Most helpful comment

https://c3js.org/samples/data_order.html

there is a great example :)

image

image

order of data and tooltip are not the same

in fact, the problem with data.order=null and stacked bars/areas is in order of data, not the tooltip or legend

if you paste this code into link above you will see that legend and tooltip have both the same order, but the data order is reversed

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 130, 200, 320, 400, 530, 750],
            ['data2', -130, 10, 130, 200, 150, 250],
            ['data5', 200, 300, 450, 600, 520, 820]
        ],
        type: 'bar',
        groups: [
            ['data1', 'data2', 'data5']
        ],
//        order: 'desc' // stack order by sum of values descendantly. this is default.
//      order: 'asc'  // stack order by sum of values ascendantly.
      order: null   // stack order by data definition.
    },
        legend: {position: 'right'},
    grid: {
        y: {
            lines: [{value:0}]
        }
    }
});

image

All 2 comments

Hi,

Could you provide a JSFiddle or Plunkr highlighting the issue?

It makes reproduction much easier for everyone.

Thank you!

https://c3js.org/samples/data_order.html

there is a great example :)

image

image

order of data and tooltip are not the same

in fact, the problem with data.order=null and stacked bars/areas is in order of data, not the tooltip or legend

if you paste this code into link above you will see that legend and tooltip have both the same order, but the data order is reversed

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 130, 200, 320, 400, 530, 750],
            ['data2', -130, 10, 130, 200, 150, 250],
            ['data5', 200, 300, 450, 600, 520, 820]
        ],
        type: 'bar',
        groups: [
            ['data1', 'data2', 'data5']
        ],
//        order: 'desc' // stack order by sum of values descendantly. this is default.
//      order: 'asc'  // stack order by sum of values ascendantly.
      order: null   // stack order by data definition.
    },
        legend: {position: 'right'},
    grid: {
        y: {
            lines: [{value:0}]
        }
    }
});

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Shugardude picture Shugardude  路  4Comments

DieterSpringer picture DieterSpringer  路  4Comments

seubert picture seubert  路  3Comments

MarcusJT picture MarcusJT  路  4Comments

mwho picture mwho  路  3Comments