Question

I'm using Dojo 1.9.1.

I'm using dojox.charting to draw some charts.

I am using a labelFunc to produce a date/time label for my X-axis. This is working fine in all browsers.

But I want to add a line break to my label so that the date sits above the time, e.g.:

10/01/2014
  06:00

I can add a html break tag to the string returned and this works in Chrome and Firefox but not IE9 (to be expected).

Has anybody solved how to do this one that works across all browsers including IE9 (or specifically ones that don't "do" html labels).

Cheers

Ian


My label func:

        _labelFull: function (index) {
            // Returns a label in the form "dd/mm/yyyy hh:mm" for tooltip labelling

            var dt,
                d;

            dt = new Date(Date.parse(myglobalStartDateTime));
            dt.setHours(dt.getHours() + Number(index));

            // Full date/time
            d = ("0" + dt.getDate()).slice(-2) + '/' +
                ("0" + (dt.getMonth() + 1)).slice(-2) + '/' +
                dt.getFullYear() + ' ' +
                ("0" + dt.getHours()).slice(-2) + ':' + 
                ("0" + dt.getMinutes()).slice(-2) + 'UTC';

            return d;
        }

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top