score:5

Accepted answer

to just add a suffix, you'd be ok using the headerformat like:

headerformat: '<span style="font-size: 10px"> {point.key}s </span><br/>'

but since you want to do division in there, you'll need to take complete control with a formatter function:

    tooltip: {
        formatter: function(d){
            var rv = (this.x / 1000).tofixed(2)  + "s <br/>";
            rv += '<span style="color:' + this.point.color + '">\u25cf</span> ' + this.series.name + ': <b> ' + this.y + '</b><br/>';
            return rv;
        }
    },

here's a working example:

$(function () {
    $('#container').highcharts({

        tooltip: {
            formatter: function(d){
                var rv = (this.x / 1000).tofixed(2)  + "s <br/>";
                rv += '<span style="color:' + this.point.color + '">\u25cf</span> ' + this.series.name + ': <b> ' + this.y + '</b><br/>';
                return rv;
			}
        },

        series: [{
            name: 'short',
            data: [[1.23 * 1000, math.random() * 10], [2.343 * 1000, math.random() * 10],[3.343 * 1000, math.random() * 10],[4.343 * 1000, math.random() * 10],[5.343 * 1000, math.random() * 10]]
        }]
    });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 300px"></div>

edits

here's an updated version of your fiddle.

with multiple series you want a shared tooltip and loop the points object:

   tooltip: {
        formatter: function(d){
            var rv = (this.x / 1000).tofixed(2)  + "s <br/>";
            this.points.foreach(function(d){
              rv += '<span style="color:' + d.color + '">\u25cf</span> ' + d.series.name + ': <b> ' + d.y + '</b><br/>';
            });                
            return rv;
        },
        shared: true
    },

full working code:

$(function () {
    $('#container').highcharts({
        chart: {
            zoomtype: 'xy'
        },
        title: {
            text: 'profile'
        },
        subtitle: {
            text: '(pressure & velocity vs. dispense time)'
        },
        xaxis: [{
            //categories: [0,48,98,150,200],
            //labels:{rotation:-45, step:0}
            title: {
                enabled: true,
                text: 'seconds from start' //seconds from start of dispense				
            },
            name: 'test',
            labels: {
                formatter: function () {
                    return highcharts.numberformat(this.value / 1000, 3);
                }
            },
            crosshair: true
        }],
        yaxis: [{ // primary yaxis
            labels: {
                formatter: function () {
                    return this.value + ' psi';
                },
                style: {
                    color: '#4572a7'
                }
            },
            title: {
                text: 'pressure',
                style: {
                    color: '#4572a7'
                }
            },
            opposite: false

        }, { // secondary yaxis
            gridlinewidth: 0,
            title: {
                text: 'vel', //pallet 
                style: {
                    color: '#89a54e'
                }
            },
            labels: {
                formatter: function () {
                    return this.value + ' mm/s';
                },
                style: {
                    color: '#89a54e'
                }
            },
            opposite: true
        }],
        tooltip: {
            shared: true,
            formatter: function(d){
                var rv = (this.x / 1000).tofixed(2)  + "s <br/>";
                this.points.foreach(function(d,i){
                  rv += '<span style="color:' + d.color + '">\u25cf</span> ' + d.series.name + ': <b> ' + d.y;
                  if (i === 0){
                      rv += ' psi';
                  } else {
                      rv += ' mm/s';
                  }
                  rv += '</b><br/>';
                });                
                return rv;
			},
            valuedecimals: 4,
        },
        plotoptions: {
            spline: {
                marker: {
                    radius: 1,
                }
            }
        },
        legend: {
            layout: 'vertical',
            align: 'left',
            x: 100,
            verticalalign: 'top',
            y: 20,
            floating: true,
            backgroundcolor: '#ffffff'
        },
        series: [{
            name: 'psi',
            color: '#4572a7',
            yaxis: 0,
            data: [
                [0, -8.527222],
                [48, -8.19928],
                [98, -8.19928],
                [150, -8.19928],
                [200, -8.19928]
            ],
            tooltip: {
                valuesuffix: ' psi'
            },
            marker: {
                radius: 2
            }

        }, {
            name: 'vel',
            color: '#89a54e',
            yaxis: 1,
            data: [
                [0, 5.376344e-02],
                [48, -5.376344e-02],
                [98, -1.075269e-01],
                [150, 0],
                [200, -2.688172e-01]
            ],
            tooltip: {
                valuesuffix: ' mm/s'
            },
            marker: {
                radius: 2
            }
        }, {
            name: 'vel',
            color: '#29a54e',
            yaxis: 1,
            data: [
                [0, -0],
                [48, 4.032258e-01],
                [98, -0],
                [150, 4.032258e-01],
                [200, -4.032258e-01]
            ],
            tooltip: {
                valuesuffix: ' mm/s'
            },
            marker: {
                radius: 2
            }
        }]
    });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 300px"></div>


Related Query

More Query from same tag