IT Support Posted May 29, 2007 Report Share Posted May 29, 2007 Hello We are using ChartFX Client Server 5.1, integrated in Active Reports. Is the attached kind of linechart possible at all? there are two values at the same position on the x-axis. Thanks for your help. Regards Luzia Baumgartner Link to comment Share on other sites More sharing options...
Frank Posted May 29, 2007 Report Share Posted May 29, 2007 Yes. You can achieve this chart using a Line chart and supplying X-Values. XValues can be supplied either through DataBinding (see DataType property) or using the API (see XValue property). Link to comment Share on other sites More sharing options...
IT Support Posted May 30, 2007 Author Report Share Posted May 30, 2007 If I only use the y-Values, my linechart is okay (see Pic 1). As soon as I use the OpenDataEx for XValues I only have one x-Point left... (see Pic 2) What am I doing wrong? This is a part of my code: .OpenDataEx CHARTFX_COD_VALUES,1,5 .OpenDataEx CHARTFX_COD_XVALUES,1,5 iRow = 0 do until rs.eof .Series(0).YValue(iRow) = ChartValue("" & rs("prValue1").Value) ' if "" & rs("prValue2").Value <> "" then ' .Series(0).XValue(iRow) = ChartValue("" & rs("prValue2").Value) ' else ' .Series(0).XValue(iRow) = ChartValue("" & rs("prValue1").Value) ' end if iRow = iRow + 1 rs.MoveNext if rs.EOF then exit do loop.Axis(CHARTFX_AXIS_Y).Max = 0.1 .Axis(CHARTFX_AXIS_Y).Min = 0.05.Axis(CHARTFX_AXIS_Y).Step = 0.005 .CloseData CHARTFX_COD_VALUES .CloseData CHARTFX_COD_XVALUES Link to comment Share on other sites More sharing options...
Frank Posted May 30, 2007 Report Share Posted May 30, 2007 Once you do: OpenDataEx for XValues Then you need to set the X-Values by uncommenting your code that sets Series(0).XValue. Link to comment Share on other sites More sharing options...
IT Support Posted May 31, 2007 Author Report Share Posted May 31, 2007 when I uncomment those 5 lines in my code, the chart comes out as follows. Only the rows 1 and 4 should have such a xvalue. Why does my chart have only one point on the x-axis? here is my resultset. note that rows 2, 3 and 5 don't have a value in the second column. Link to comment Share on other sites More sharing options...
Frank Posted May 31, 2007 Report Share Posted May 31, 2007 Looks like your X-Values are all less than 1. Since you are not displaying any decimals in the X-Axis this is what you get. To set the number of decimals in the X-Axis: chart.Axis(AXIS_X).Decimals = 2; Link to comment Share on other sites More sharing options...
IT Support Posted June 4, 2007 Author Report Share Posted June 4, 2007 I changed the initializing of the chart, I make it manually now instead of using the template. The values are multiplied by 100 now, so you can see that the ordinary line is ok. But the thing with the xvalues doesn't work yet! there is no difference in the chart wether I set them or not. Sub OnFormat set rs = RecordSet() if rs.EOF then exit subwith rpt.Sections("PageHeader").Controls("ChartFX1") 'initialze chart.ToolBar = False.PaletteBar = False.MenuBar = False.PatternBar = False.DataEditor = False.Border = False.BorderStyle = 0 .ClearData 1 iRow = 0 .OpenDataEx CHARTFX_COD_VALUES,1,iRow + 1 .OpenDataEx CHARTFX_COD_XVALUES,1,iRow + 1 do until rs.eof .Series(0).YValue(iRow) = ChartValue("" & rs("prValue1").Value) .Axis(CHARTFX_AXIS_X).Label(iRow) = "" & rs("txValue").Value if "" & rs("prValue2").Value <> "" then.Series(0).XValue(iRow) = ChartValue("" & rs("prValue2").Value) else.Series(0).XValue(iRow) = ChartValue("" & rs("prValue1").Value) end ifiRow = iRow + 1 rs.MoveNext if rs.EOF then exit do loop.CloseData CHARTFX_COD_VALUES .CloseData CHARTFX_COD_XVALUES .Series(0).Gallery = 1 'Line.Chart3D = False.RGB2DBk = RGB(255,255,255) .RGBBk = RGB(255,255,255) .Grid = 1 'Horizontal.Axis(CHARTFX_AXIS_Y).Max = 8 .Axis(CHARTFX_AXIS_Y).Min = 5.Axis(CHARTFX_AXIS_Y).Step = 0.5 .Axis(CHARTFX_AXIS_Y).Decimals = 2 .Axis(CHARTFX_AXIS_X).Decimals = 2 end with rs.movefirst End Sub Link to comment Share on other sites More sharing options...
Frank Posted July 18, 2007 Report Share Posted July 18, 2007 This is very simple. I don't know what else to add. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.