R2006 Posted March 1, 2007 Report Share Posted March 1, 2007 Even with the staggered feature turned on, long series names can run into each other for charts with many data points. Excel's charts have a wrapping feature that automatically wraps the x-axis label text to respect it's real-estate. In addition to vertical/45%/Staggered...a "wrapping" option would be a very helpful feature to add to 2005. After reviewing the forum I see this is a freuquent request. Link to comment Share on other sites More sharing options...
Frank Posted March 2, 2007 Report Share Posted March 2, 2007 This should do what you are looking for: chart1.AxisX.Style &= ~AxisStyles.SingleLine; chart1.AxisX.Step = 1; // Or any FIXED number. This will fix the space and then wrapping will occur if the space is not enough. Link to comment Share on other sites More sharing options...
R2006 Posted March 4, 2007 Author Report Share Posted March 4, 2007 Thank you for the response. I have a bar chart that has 10 or so series that a represented in the chart as bars (so 10 vertical bars). The descriptions of the 10 items on the x-axis "run into" each other...even when staggered. When I implement the fix suggested, all of the bars shift over to the left (next to the Y1 axis) to where the first bar was originally. It looks like they are all piled on top of each other. So instead of 10 bars, it looks like I have one bar (which I think is really 10 in the same location). Am I doing something wrong? Link to comment Share on other sites More sharing options...
Frank Posted March 4, 2007 Report Share Posted March 4, 2007 Can you please post the code that reproduces this problem? I don't see how the code I posted can cause this. Link to comment Share on other sites More sharing options...
R2006 Posted March 5, 2007 Author Report Share Posted March 5, 2007 VB Code: Chart.AxisX.Style = ChartFX.WinForms.AxisStyles.SingleLine Chart.AxisX.Step = 1 Chart.AxisX.Step = 1 Link to comment Share on other sites More sharing options...
Frank Posted March 5, 2007 Report Share Posted March 5, 2007 My code: chart1.AxisX.Style &= ~AxisStyles.SingleLine; Your code: Chart.AxisX.Style = ChartFX.WinForms.AxisStyles.SingleLine Not quite the same. I am leaving all flags as they were and turning ON SingleLine, you are turning OFF every other flag and leaving SingleLine ON The equivalent VB code would be: Chart1.AxisX.Style = Chart1.AxisX.Style And Not ChartFX.WinForms.AxisStyles.SingleLine Link to comment Share on other sites More sharing options...
R2006 Posted March 5, 2007 Author Report Share Posted March 5, 2007 Thanks...We will try this. Link to comment Share on other sites More sharing options...
R2006 Posted March 8, 2007 Author Report Share Posted March 8, 2007 Tried the new code you suggested. The chart did not change visually. I looked online for documentation on the "Style" capabilities and could not find "SingleLine". Is there somewhere I could read up on the options for this property so I can experiment without having to pester you? Thanks Link to comment Share on other sites More sharing options...
Frank Posted March 8, 2007 Report Share Posted March 8, 2007 Please paste the following code into a brand new VB project with a default chart in it: Chart1.Data.Series = 1 Chart1.Data.Points = 3 Chart1.Data(0, 0) = 10 Chart1.Data(0, 1) = 20 Chart1.Data(0, 2) = 30 Chart1.AxisX.Labels(0) = "Label One" Chart1.AxisX.Labels(1) = "Label Two" Chart1.AxisX.Labels(2) = "Label Three" Chart1.AxisX.Labels(3) = "Label Four" Chart1.AxisX.Step = 1 Chart1.AxisX.Style = Chart1.AxisX.Style And Not ChartFX.WinForms.AxisStyles.SingleLine Chart1.Width = 300 Chart1.PlotAreaMargin.Bottom = 50 This demonstrates the functionality we discussed.. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.