We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Label template problem with a date field

Hi,

I'm trying to use this label template in a colum chart :

<div id="template" style="display:none">
    <div id="right" style="text-align:center; color: white; font-size: 0.8em">
        <div>#point.x#</div>
        <div>#point.y# km</div>
    </div>
</div>

The x axis data is a date and instead of diplaying the date itself or the date label, I see "Nan/Nan" on the chart (I've attached a screen capture).

Here is a sample of my data:
[ { Date: "2015-12-01T17:02:16.458+01:00", Distance: 297, Elevation: 2728, Speed: 297}, ...]

And the chart definition:
$("#BikeChart").ejChart({
    canResize: true,
    title: { text: 'Bike Summary' },
    primaryXAxis: { valueType: 'datetime', labelFormat: "MM/yy", intervalType: 'months' },
    primaryYAxis: { title: { text: "Distance" }, labelFormat: '{value} km', rangePadding: 'round' },
    commonSeriesOptions: { type: 'column', tooltip: { visible: true }, points: [] },
    series: [
         { name: 'Distance', xName: 'Date', yName: 'Distance',
           marker: { dataLabel: { visible: true, textPosition: "bottom", template: "template" } } }
                ]
            });

Any idea why the display in incorrect and if it's possible to format the date field in the template (displaying the name of the month) ?

Thanks !
Jean-Philippe

Attachment: Capture_ea311cbb.zip

1 Reply

SK Sanjith Kesavan Syncfusion Team January 4, 2016 12:19 PM UTC

Hi Jean-Philippe,

Thanks for contacting syncfusion support. We have analyzed your query and replicated the scenario in our sample. We can able to reproduce the reported issue. We have logged issue report on this. For your better follow-up we have created the new branched incident in your account.

Please let us know if you have any concern.

Regards,
Sanjith K.

Loader.
Live Chat Icon For mobile
Up arrow icon