Jump to content
Software FX Community

Bar Width in chart with few datapoints

User (Legacy)

Recommended Posts

I have a bound horizontal bar chart on a page.  Usually this chart shows 

eight values, but sometimes there are only a few data points (like at

the end of the datatable). when that happens the bars get very wide.

Is there any way to force the chart to draw the bars exactly the same

width even if there is only one or two data points?

Link to comment
Share on other sites

SoftwareFX Support wrote:

> The same as what ? The same as when there is <n> datapoints ? If this is

> what you want simply increase the number of points to <n> and fill their

> values with Chart.Hidden.



I had actually just started down that route, but I am having trouble

understanding how to add the points. I know that the size of the

DataTable is usually 10 records because we are doing paging using stored


The following is the skeleton of my FillChart Procedure. I have used

OpenData() in an old VB 6 app where the date is in arrays, but how do I

add or insert the points when I am binding to the DataTable.

Link to comment
Share on other sites

After binding occurs, you can use OpenData and fill the rest of the points. 

For example:

private void CompleteWithHidden (int newPointCount)


int oldPointCount = chart1.NValues;


for (int i = 0; i < chart1.NSeries; i++) {

for (int j = oldPointCount; j < newPointCount; j++) {

chart1.Value[i,j] = Chart.Hidden;






Francisco Padron


Link to comment
Share on other sites


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

  • Create New...