User (Legacy) Posted May 9, 2006 Report Share Posted May 9, 2006 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 More sharing options...
Software FX Posted May 9, 2006 Report Share Posted May 9, 2006 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. -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
User (Legacy) Posted May 9, 2006 Author Report Share Posted May 9, 2006 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. > Thanks. 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 procedures. 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 More sharing options...
Software FX Posted May 9, 2006 Report Share Posted May 9, 2006 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; chart1.OpenData(COD.Values,chart1.NSeries,newPointCount); for (int i = 0; i < chart1.NSeries; i++) { for (int j = oldPointCount; j < newPointCount; j++) { chart1.Value[i,j] = Chart.Hidden; } } chart1.CloseData(COD.Values); } -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.