WelcomeForumsCommunitycustom x-axis labels for time series

Wijmo Team Member
grektokomus posted on May 4, 2012 at 7:15 am link

Pursuant to this thread: custom datetime labels

I have a time series that are about every 5 minutes with some gaps. I may want to plot 400+ data points at once. I would simply like to label the x-axis with each new day.

My attempts to manipulate the object model have not born fruit. It seems that the linear grid ignores annoMethod/valueLabels/annoFormatString when the series is datetime data?

Is there a way to accomplish my objective other than passing in the series as ints and reconstructing a label series as string representations of the time?

best,greg

Wijmo Team Member
lianbo posted on May 4, 2012 at 7:45 am link

Hi greg,
I think this feature is supported in current version. You can have a try.

Answer
Wijmo Team Member
grektokomus posted on May 4, 2012 at 1:55 pm link

Thank you Lianbo. I have spend several hours trying, and it seems not to work at all.

when the x series is time data, this code is ignored:
annoMethod: “valueLabels”,
valueLabels: xlabels,

when the x series are integers, the same code is not ignored.

Can you confirm this?

Answer
Wijmo Team Member
grektokomus posted on May 7, 2012 at 1:00 am link

Labeling seems to be working fine. I thought I was successfully casting JSON date ( ex: /Date(1224043200000)/ ); however I was not. When I cast it thusly, the x-axis started working:
var date = new Date(parseInt(jsonDate.substr(6)));

reference: http://stackoverflow.com/questions/206384/how-to-format-a-json-date

Answer
Wijmo Team Member
lianbo posted on May 7, 2012 at 3:13 am link

Hi greg,
I tested the code and found that it works when the axis is datetime.
There are 2 ways to reset the axis label,
1.set annoFormatString = “yyyy/MM/dd” or other format you want.
2.set annoMethod = “valueLabel” and valueLabel = ['a', 'b', ...]
If it still doesn’t work for you, please provide a sample to reproduce this issue.

Answer
Wijmo Team Member
gogreensolar posted on September 13, 2012 at 8:40 pm link

I have a similar issue with this, my code is here:
http://216.70.87.34/sunpole-data.php

Would like x axis to only show labels every 3 hours (6am, 9am, 12pm, etc). What is the best way to do this?

Answer
Wijmo Team Member
Ashish Jindal posted on September 14, 2012 at 6:05 am link

Hello,

The best way to accomplish the same would be to use valueLabels. As mentioned in above post by Lianbo, you need to set the annoFormatString and annoMethod property.

Regards

Answer
Wijmo Team Member
gogreensolar posted on September 14, 2012 at 10:50 pm link

using the valueLabels method, is it possible to still retain the x axis data to show up in the tooltip, but just not on the label?

Answer
Wijmo Team Member
Ashish Jindal posted on September 17, 2012 at 7:08 am link

Hello,

You can display x axis data in the tooltip with the help of below code:

 hint: {
             content: function () {
                        return this.x;
                    }
          },

Regards

Answer
Wijmo Team Member
gogreensolar posted on September 19, 2012 at 12:36 am link

The value labels do not seem to be working, can you please check my code?

Answer

This topic has 4 voices, contains 9 replies, and was last updated by  gogreensolar 274 days ago.

You must be logged in to reply to this topic.