Jump to content
Software FX Community

Smart Labeling Granularity


User (Legacy)

Recommended Posts

I have a line graph where the x axis represents dates. I would like to use

the smart labeling feature except each period of data I have represents the

value on the first day of that month. So I turned off the AutoCenter

property (AxisX.Style &= ~AxisStyle.AutoCenter). I have formatted the labels

so that they show the dates as Jan-2005 but I get multiple Jan-2005 labels

each representing different days in the month based on space available. Is

there any way to restrict the frequency of the labeling to months? I read

that the step couldn't go smaller then the minor step so I tried setting the

minor step to 30 but that didn't work. I also tried having a data format for

the axis of both date and datetime.

The only way I have found to do this is by setting the step to automatic

before every resize or zoom and then checking if it is between -30 and 0

(indicates that more then one label will appear for each month) and if so

setting the step to 30 (monthly). If I do this though you can see the extra

labels appear and then disappear when I set the step to 30 and when it is

automatically choosing the step, the points it picks aren't necessarily the

first of each month.

Is there any way to do this with the smart labeling or do I have to

implement this manually by creating my own CustomSteps each time the user

resizes or zooms the graph? Also I read somewhere that 30 as a step for a

datetime axis is a special value. Does a step of 30 refer to a month no

matter how many days the month actually has or will it just add steps of 30

days? Thanks -Chris

Link to comment
Share on other sites

If you want the X-Axis step to be FIXED to one month simply set:

chart.AxisX.Step = 30;

By default Chart FX uses the smallest step possible given the the size, in

this case it is using 15 days (bi-monthly).

Frank

SFX

"Chris Muno" <tofumuno@hotmail.com> wrote in message

news:bVlYMyzIFHA.1924@webserver3.softwarefx.com...

>I have a line graph where the x axis represents dates. I would like to use

> the smart labeling feature except each period of data I have represents

> the

> value on the first day of that month. So I turned off the AutoCenter

> property (AxisX.Style &= ~AxisStyle.AutoCenter). I have formatted the

> labels

> so that they show the dates as Jan-2005 but I get multiple Jan-2005 labels

> each representing different days in the month based on space available. Is

> there any way to restrict the frequency of the labeling to months? I read

> that the step couldn't go smaller then the minor step so I tried setting

> the

> minor step to 30 but that didn't work. I also tried having a data format

> for

> the axis of both date and datetime.

>

> The only way I have found to do this is by setting the step to automatic

> before every resize or zoom and then checking if it is between -30 and 0

> (indicates that more then one label will appear for each month) and if so

> setting the step to 30 (monthly). If I do this though you can see the

> extra

> labels appear and then disappear when I set the step to 30 and when it is

> automatically choosing the step, the points it picks aren't necessarily

> the

> first of each month.

>

> Is there any way to do this with the smart labeling or do I have to

> implement this manually by creating my own CustomSteps each time the user

> resizes or zooms the graph? Also I read somewhere that 30 as a step for a

> datetime axis is a special value. Does a step of 30 refer to a month no

> matter how many days the month actually has or will it just add steps of

> 30

> days? Thanks -Chris

>

>

>

>

post-2107-13922379566717_thumb.jpg

Link to comment
Share on other sites

  • 4 weeks later...

Unfortunately this doesn't help. If you do this you get a label every month

even if there isn't enough space for them. This is why I was asking if there

was a way to get the smart labeling (which is turned off by setting the Step

property) for a date axis where the dates are in monthly intervals. The only

way I have found to do this is to use a categorical axis and set the dates

as strings myself. This leads to other problems though. For instance when I

hide a series the autoscale would remove periods where that was the only

series. With the categorical axis this doesn't happen. Thanks anyways, Chris

"Frank" <noreply@softwarefx.com> wrote in message

news:sggQPXEJFHA.1924@webserver3.softwarefx.com...

> If you want the X-Axis step to be FIXED to one month simply set:

>

> chart.AxisX.Step = 30;

>

> By default Chart FX uses the smallest step possible given the the size, in

> this case it is using 15 days (bi-monthly).

>

> Frank

> SFX

>

>

> "Chris Muno" <tofumuno@hotmail.com> wrote in message

> news:bVlYMyzIFHA.1924@webserver3.softwarefx.com...

> >I have a line graph where the x axis represents dates. I would like to

use

> > the smart labeling feature except each period of data I have represents

> > the

> > value on the first day of that month. So I turned off the AutoCenter

> > property (AxisX.Style &= ~AxisStyle.AutoCenter). I have formatted the

> > labels

> > so that they show the dates as Jan-2005 but I get multiple Jan-2005

labels

> > each representing different days in the month based on space available.

Is

> > there any way to restrict the frequency of the labeling to months? I

read

> > that the step couldn't go smaller then the minor step so I tried setting

> > the

> > minor step to 30 but that didn't work. I also tried having a data format

> > for

> > the axis of both date and datetime.

> >

> > The only way I have found to do this is by setting the step to automatic

> > before every resize or zoom and then checking if it is between -30 and 0

> > (indicates that more then one label will appear for each month) and if

so

> > setting the step to 30 (monthly). If I do this though you can see the

> > extra

> > labels appear and then disappear when I set the step to 30 and when it

is

> > automatically choosing the step, the points it picks aren't necessarily

> > the

> > first of each month.

> >

> > Is there any way to do this with the smart labeling or do I have to

> > implement this manually by creating my own CustomSteps each time the

user

> > resizes or zooms the graph? Also I read somewhere that 30 as a step for

a

> > datetime axis is a special value. Does a step of 30 refer to a month no

> > matter how many days the month actually has or will it just add steps of

> > 30

> > days? Thanks -Chris

> >

> >

> >

> >

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...