ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Display Date Format
Posted by Steven on Feb-18-2016 09:28
Attachments:
Hello
Now My day is error and number is error
How can I fixed thant?
test.png
test2.png

  Re: Display Date Format
Posted by Peter Kwan on Feb-19-2016 01:37
Hi Steven,

In your chart, from the bar at the bottom, it seems the start date and end date are configured to be from "Apr 25, 2012" to "Apr 25, 2013". The axis at the top is showing the same range. It seems the axis is configured to show one label every month, and the year, month and day are configured to be in 3 lines. If this is the case, then the chart should be correct.

Would you mind to clarify which part of the chart you think is incorrect? Is it the axis range that is incorrect (should it be  "Apr 25, 2012" to "Apr 25, 2013")? Or is it the label positions incorrect (should it be 1 label per month)? Note that the axis range and the label duration are specified by your code. The year, month and day are in 3 lines, probably is specified by your code too.

May be you can inform me of the charting part of your code so I can see if the chart is consistent with your code. If you cannot post your code in a public forum, you may email to me at pkwan@advsofteng.net

Regards
Peter Kwan

  Re: Display Date Format
Posted by Steven on Feb-19-2016 08:46
Hi Peter
First,thanks for your reply,and I want Few days each month under,Not display one month one day

  Re: Display Date Format
Posted by Peter Kwan on Feb-20-2016 04:12
Hi Steven,

Are you using code like the followings to configure the hgrizontal axis?

$c->yAxis->setDateScale(chartTime(2012, 4, 25), chartTime(2013, 4, 25), 86400 * 30);

If this is the case, the spacing between labels is "86400 * 30" or 1 month. (86400 seconds is one day.) If you want to have a label every 10 days, you may use "86400 * 10" instead.

$c->yAxis->setDateScale(chartTime(2012, 4, 25), chartTime(2013, 4, 25), 86400 * 10);

Note that if you have too many labels and the chart is not big enough, the labels may become too close together. In this case, some of the labels will be hidden. You can reduce the margin between labels to 0 using:

$c->yAxis->setLabelStyle("arial.ttf", 8)->setMargin(0);

With the above code, if the labels do not overlap, they will be displayed. However, if a label overlaps with the previous label, it will still be hidden.

Hope this can help.

Regards
Peter Kwan

  Re: Display Date Format
Posted by Steven on Feb-22-2016 15:12
Attachments:
Hi Peter
Can I display once month?
Not everyday display every time
test2.png

  Re: Display Date Format
Posted by Peter Kwan on Feb-23-2016 03:41
Hi Steven,

By "Can I display once month?", do you mean you want to display the month only once, even if there are multiple days in a month?

If you use the code in my first reply, then each month will only appear once:

$c->yAxis->setMultiFormat(StartOfMonthFilter(), "<*font=arialbd.ttf*>{value|mmm d}",
    StartOfDayFilter(), "-{value|d}");

Hope this can help.

Regards
Peter Kwan

  Re: Display Date Format
Posted by Steven on Feb-26-2016 09:02
Hi Peter
Can I do that at after?
Before.
2015/01
1 2 3 4 5 .. ......

After.
            2015/01
1 2 3 4 5 ......

Year / Month  In the Center , Not in the Left

  Re: Display Date Format
Posted by Peter Kwan on Feb-27-2016 04:59
Hi Steven,

You can try to use two horizontal axis for the day labels and for the year/month labels. It is like:

$firstDate = chartTime(2016, 1, 1);
$lastDate = chartTime(2016, 2, 29);

#Labels showing the day of month only
$c->yAxis->setDateScale($firstDate, $lastDate, 86400);
$c->yAxis->setLabelFormat("{value|d}");
$c->yAxis->setLabelStyle("arial.ttf", 8)->setMargin(0);

#Labels showing the year and month
$monthAxis = $c->addAxis(Top, 18);
$monthAxis->setDateScale($firstDate, $lastDate, 86400 * 30);
$monthAxis->setLabelFormat("{value|yyyy-mm}");
$monthAxis->setColors(Transparent, 0x000000);
$monthAxis->setLabelOffset(15 * 86400);
$monthAxis->setLabelStyle("arialbd.ttf", 10);

Hope this can help.

Regards
Peter Kwan

  Re: Display Date Format
Posted by Steven on Mar-01-2016 08:44
Hi Peter
Thank you for taking the time to Reply
Now I have other problem
1.
Now.
2016/01
01 02 03 .....

I hope to do like.
2016/01
01    02   03
Mon Tue Wed

2. I am Taiwanese
hope week can change to our text 'Chinese' (Monday Tuesday...)

Can I do it?

  Re: Display Date Format
Posted by Steven on Mar-02-2016 16:49
I fixed that problem.
Now
How to use ImageMap Display Value?
viewer.ImageMap = c.getHTMLImageMap("clickable", , "title='{x}{value}'")
It can't get start date and end date

  Re: Display Date Format
Posted by Peter Kwan on Mar-02-2016 20:38
Hi Steven,

May be you can try:

viewer.ImageMap = c.getHTMLImageMap("", "",
        "title='{xLabel}: {top|yyyy-mm-dd} to {bottom|yyyy-mm-dd}'")

Hope this can help.

Regards
Peter Kwan

  Re: Display Date Format
Posted by Steven on Mar-03-2016 09:59
Attachments:
Hi Peter
My Code :

    Dim C As XYChart
    Dim monthAxis As ChartDirector.Axis
    Call C.yAxis().setDateScale(viewPortStartDate, viewPortEndDate, 86400)
    Call C.yAxis().setLabelFormat("{value|d}")
    Call C.yAxis().setLabelStyle("arial.ttf", 8).setMargin(0)


    Set monthAxis = C.addAxis(Top, 18)
    Call monthAxis.setDateScale(cd.chartTime(2016, 1, 1), cd.chartTime(2016, 2, 29), 86400 * 30)<----- Error
    Call monthAxis.setLabelFormat("{value|yyyy-mm}")
    Call monthAxis.setColors(cd.Transparent, &H0&)
    Call monthAxis.setLabelOffset(15 * 86400)
    Call monthAxis.setLabelStyle("arialbd.ttf", 10)

Why?
2016-03-03_095616.bmp
2016-03-03_095616.bmp

207.12 Kb

  Re: Display Date Format
Posted by Peter Kwan on Mar-03-2016 21:46
Hi Steven,

In VB6, the Script:

Set monthAxis = C.addAxis(Top, 18)

should be:

Set monthAxis = C.addAxis(cd.Top, 18)

You may consider to enable "Option Explicit" in your VB6 code. In this case, the VB6 interpreter should check that the code and tell you that "Top" is undefined. This can make trouble-shooting easier.

Hope this can help.

Regards
Peter Kwan

  Re: Display Date Format
Posted by Steven on Mar-04-2016 10:06
Attachments:
Hi Peter
Everything is work great
but I have other problem
In the Picture
Green bar is too small
Can I set the minimum size of it?
2016-03-04_095930.gif

  Re: Display Date Format
Posted by Steven on Mar-04-2016 17:24
I find solution
thanks a lot Peter