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

Region number should be exposed for stacked bar charts #21

Open gwatts opened 12 years ago

gwatts commented 12 years ago

Exposing the region number would allow lookup values to be keyed against the region rather than just the value or offset

Eg. for a stacked bar chart where you want the first series to have prefix "first" and the second series "second":

        $('#mysparkline').sparkline('html', 
            {
                type: 'bar', 
                tooltipFormat: '{{region:prefixes}} {{value}}', 
                tooltipValueLookups: {prefixes: {0: 'first', 1: 'second'}}
                }
        );