Jump to content
Software FX Community

How to Skip Weekend from Date Range on Daily Basis Chart


imran_javed@hotmail.com

Recommended Posts

Hi,

We have a line chart with as much as 1000+ or more date values in x-axis and numeric values on y-axis. We can have more then one series in the chart.

We are using arraylist of dates to pouplate x-axis. this data does not contain weekends. Therefor it has only data for Monday to Friday and Satureday, Sunday Dates are skiped from the series. But Chart shows dates lines/space for Satureday and Sundays.

Can you help me to skip the weekends from the chart showing data for years, 1 to 5 years on daily basis? I tried AutoScall property but it make chart crash and not displayed.

Thanks

Link to comment
Share on other sites

  • 3 weeks later...

The X-Axis can be one of the following 2:

- Continuous: In this mode the scale will be continuous and not dictated by the data points but by a range and a step.

- Discrete/Categorical: The X-Axis is simply a collection of points. There is no fixed relationship between the labels, they are simply strings.

Some chart type: Bars,Hi-Low-Close,Candlestick and Cubes only support discrete/categorical X-Axis, therefore, if like in your case, the date skips some values, they will be reflected in the X-Axis.

When your chart contains X-Values and the X-Axis it is categorical, we do what we call "Data Driven Labeling" in which we let the data control the labels on the X-Axis, not the range, but the actual points.

In a continuous X-Axis, the data is irrelevant. Only the range has an effect on the X-Axis labeling.

Looks to me that you want to have Data Driven labels, but by default, if your chart is not one of the galleries mentioned above, your X-Axis will be continuous. You can change this by setting:

chart.ExtraStyle |= ChartStyles.ForceDataDriven;

Link to comment
Share on other sites

Hi Frank,

We are using Line Chart and I am afraid this is not working for us.

we were using following

chart.DataSourceSettings.Fields.Add(new ChartFX.WebForms.FieldMap("Field1", ChartFX.WebForms.FieldUsage.XValue));

now we are used following

chart.DataSourceSettings.Fields.Add(new ChartFX.WebForms.FieldMap("Field1", ChartFX.WebForms.FieldUsage.Label));

and it works fine and weekends are skipped but it is disabling Sections added on that axis

can you assist further in this context

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...