0

I'm using jqPlot to display some nice charts. i want to use data['values'] for creating the chart. data['pointvalues'] for the highlighting tooltip and data['labels'] for the labels. Data for jqPlot

My plotcall is pretty basic:

            var plot1 = $.jqplot ('chart', data['values'],{
            cursor:{
                show:true,
                zoom:true,
                showTooltip:false
            },
            series:{

            },
            legend: {
                show: true,
                placement: 'outsideGrid'
            },
            highlighter: {
                show: true
            }
        });

Edit - Solution Labels:

legend: {
                show: true,
                placement: 'outsideGrid',
                labels: data['labels']
            },

Point Values in LineChart:

$('#chart').bind('jqplotDataMouseOver',
        function (ev, seriesIndex, pointIndex) {
            $('.jqplot-highlighter-tooltip').text('Kalenderwoche: '+(pointIndex+1)+' ,'+data['labels'][seriesIndex]+': '+data['pointvalues'][seriesIndex][pointIndex]);
            $('.jqplot-highlighter-tooltip').css('opacity',1);

        });
Jens
  • 345
  • 1
  • 6
  • 19

1 Answers1

0

Now you need to understand that one thing is after you give the data to the plot the function itself assign the values to highlighters and labels, for all these you can only provide one data set. If you want to format labels with $ signs use tick options.

Juliyanage Silva
  • 2,529
  • 1
  • 21
  • 33