Sign in to follow this  
Sno

MSLine2D xAxis Label rendering

Recommended Posts

Hello everybody!

I have two questions concerning xAxis Label of MSLine2D charts..

 

First of all :

 - How do I manage the display of labels on xAxis?

I've already tried the labelStep attribute to the <chart> tag :

 

<chart caption='AverageProcess time' stepLabel = '7'>

But it goes on rendering ALL the label from the <category> tag.

My second question is more SQL-PHP side :
- I set my categories label from a database, where all the dates for a process start are set. So, for every process, there is a lot of dates.

but in my SQL query, i wrote :
 

SELECT p.DateStart, p.Name, p.Id
FROM processes
ORDER BY (p.Name, ASC)

That gives me a chart with xAxis label like : '23/04/2013' '25/04/2013' '27/04/2013' (which is for the first process) followed by : '22/04/2013' '23/04/2013' 25/04/2013' (which is for the second process)

So, i would like to render my labels by chronological order. How do i do that? by SQL (on Oracle database), by PHP or by XML??

Thanks by advance!

Share this post


Link to post
Share on other sites
Guest Rishab

Hi,

 

To manage the display of labels on xAxis please use the attribute 'labelStep' of the <chart> element.
 

For your second query, I suggest you to try using-

ORDER BY (p.DateStart, ASC)

 If this is not you are looking for please provide some more information that may help us in comprehension.

Share this post


Link to post
Share on other sites

Hi Rishab,

Frist of all thanks for your answers.

 

Well, in my topic, i totally made a mistake : my <chart> tag is already having a labelStep = '7' . But i miswrote it in this topic.

So, even with a labelStep = '7', there is no change in the display of xAxis labels...

 

And for my query, i've done it after some researches.

i do
 

ORDER BY pRun.DateStart ASC, p.Name ASC

But now, i have some difficulties with the treatment of the result, because i obtain something like this : (because it ordered everything by dates)
 

pId01 pName01 DateStart001 Value01
pId01 pName01 DateStart002 Value02
pId02 pName02 DateStart003 Value01
pId01 pName01 DateStart004 Value03

And i have a lot of difficulties to render the <dataset label''> and the <set value> which have to match the p.ID AND the pRun.DateStart...
I've tried with multiple arrays, but i don't get the logic here, so if you could give me some advices, that would be very helpful !!

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Regarding "labelStep" attribute issue, could you please provide the complete XML data, so that we could probably test and replicate the issue, as we are not able to replicate the issue with default XML data, form our end?

 

However, regarding your SQL query issue, if you will provide the database table structure, we can better help you out.

Share this post


Link to post
Share on other sites

Hi Sashibhusan,

Thanks for your answer, i figured out how to have my data <set> working good.
I still have a problem with the XAXIS label and the divisions of the background.

 

charts_xaxis_label.png

Here, in the file i sent, you can see a graph representing a process running during last week. In the XAxis, you can see the dates (there are several dates which are the same and that's normal), and in the YAxis, the performing duration of the process. Simple, isn't it?

My problem here, is that i would like to divide the background of the charts to represent a step.
Explication : here, i see the performing times for the process for last week, and i would like to divide the background in 7 parts, for each day of the week.
And in the XAxis, i would like to display some dates/hours, but not ALL of them (there are too much)

Could you help me please?

Here is the XML generated : (i had to erase some lines randomly, because the forum doesn't like "post too long") but if you want to see it integraly, i attached it to this post.xmlTests.xml

 

<chart caption="Average performing time calculated of the last Week" linethickness="1" formatnumberscale="1" anchorradius="2" anchoralpha="0" divlinealpha="20" divlinecolor="CC3300" divlineisdashed="1" showalternatehgridcolor="1" alternatehgridalpha="5" alternatehgridcolor="CC3300" labelstep="7" showvalues="0" labeldisplay="Rotate" numvdivlines="5" chartrightmargin="35" bgcolor="FFFFFF,CC3300" bgangle="270" bgalpha="10,10">
    <categories>
        <category label="04/09/2013 14:18:47"> </category>
        <category label="04/09/2013 14:20:47"> </category>
       <category label="10/09/2013 08:52:47"> </category>
        <category label="10/09/2013 08:54:47"> </category>
        <category label="10/09/2013 08:56:47"> </category>
        <category label="10/09/2013 08:58:46"> </category>
        <category label="10/09/2013 09:00:47"> </category>
        <category label="10/09/2013 09:02:47"> </category>
        <category label="10/09/2013 09:04:47"> </category>
        <category label="10/09/2013 09:06:46"> </category>
        <category label="11/09/2013 14:16:46"> </category>
    </categories>
    <dataset seriesname="process01" color="FF0000">
        <set value="35"> </set>
        <set value="23"> </set>
        <set value="31"> </set>
        <set value="15"> </set>
        <set value="34"> </set>
        <set value="26"> </set>
        <set value="12"> </set>
        <set value="55"> </set>
        <set value="30"> </set>
        <set value="17"> </set>
    </dataset>
</chart>

thanks for the help!

Share this post


Link to post
Share on other sites
Guest Rishab

Hi,

 

To divide the background for representing the day specific interval in your chart, you can use vLines.

 

Vertical Separator Lines you to separate blocks of data. Use <vLine> chart element between the date range you want.

 

For example-

<category label="04/09/2013 08:52:47"> </category>
<vLine color='FF5904' thickness='1' />   
<category label="05/09/2013 08:52:47"> </category>

For further reference please visit-
http://docs.fusioncharts.com/charts/contents/ChartSS/MSLine.html#Anchor17

In addition, you can hide the vertical gridlines by removing the <chart> element attribute, 'numvdivlines'.

Please use 'labelStep' attribute of the <chart> element to show every n-th label for better clarity.

 

The attached screenshot and the sample may also help you.

post-47865-0-44595000-1378983597_thumb.jpg

Data.xml

Edited by Rishab

Share this post


Link to post
Share on other sites

Well, thanks for the answer, but this is not what i want.
I want to divide datas by parts (7 parts for a week, each part representing a day), not just adding vlines.
But, i'm surprised : i tried to render your xml, and well, the horizontal dashed lines are overdrawn by dark lines (see my attached image of previous post), while yours are clear and readable. Why is that? i totally would like to clear those dark lines, erasing them or shading them to minus alpha...

And well, i'll try to resolve my other issues by myself.

Thanks for your time again

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this