We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ChartControl border goes off...is it a Bug???

Hi, In a form, 1. Put a Chart Control. 2. Goto "InitializeComponent" menthod of the form. 3. Say this.chartControl1.PrimaryXAxis.DrawGrid = false; this.chartControl1.PrimaryYAxis.DrawGrid = false; 4. Now the look at the chart area of the chart control, the borders around it is not there. 5. Should the "draw grid = false" make the borders invisible?. 6. Is there a way to make the borders visible while setting the drawgrid to false. Thanks, Atanu

5 Replies

AD Administrator Syncfusion Team August 17, 2005 03:04 PM UTC

Hi Atanu, The "borders" you see initially are the grid lines at the ends of the chart rendering area. That''s why the borders are not displayed when the grid lines are turned off. To get a border for the ChartArea, you can use the BorderStyle property of the ChartArea: this.chartControl1.ChartArea.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; This border will look different as it includes the axes area also. Thanks, Davis

AP Atanu Podder August 17, 2005 05:26 PM UTC

Okie, but suppose i say the drawgrid of Yaxis is false, that should mean the vertical border should not be drawn and if I say drawgrid of XAxis false then horizntal border should not be drawn. And if I say drawgrid false for both of them then none of the borders should be drawn. But the chart borders are drawn if any one may it be Xaxis or Yaxis has drawborder true, So, I am little confused here how is the drawgrid property of YAxis draws the horizontal border (TopBorder) of the Chartarea? And also, is it possible to draw the borders in a different color and the grids insode the chart in different color? I mean I want to have a different colored border which should not look similar to the grid line in the chart... Thanks, Atanu

AD Administrator Syncfusion Team August 18, 2005 06:45 PM UTC

Hi Atanu, The X axis grid lines are drawn for each major tick and also for the left edge - this is on top of the Y axis line itself. Since the Gridline is a 1 pixel back line and the Y axis is also a 1 pixel back line, the difference is not visible. Please see the image below. It shows the X axis gridlines clearly by setting a different color and thickness to them: this.chartControl1.PrimaryXAxis.GridLineType.ForeColor = System.Drawing.Color.IndianRed; this.chartControl1.PrimaryXAxis.GridLineType.PenType = System.Drawing.Drawing2D.PenType.PathGradient; this.chartControl1.PrimaryXAxis.GridLineType.Width = 5F; You can differentiate the grid lines by setting the above properties. Thanks, Davis

AP Atanu Podder August 22, 2005 04:58 PM UTC

Hi, Davis, Thanks for the reply, In the example shown above, I just wanted to know, as we have mentioned the grid line color of XAxis is Red, then how the all the Right border and the top border is drawn with the same color. And also, after setting the Xaxis grid line type, if i set the y axis grid line type to some other color, then again the top border and the right border becomes the new color. So , how grid line type of one axis is modifying both the borders, horzontal as well as vertical? Thanks, Atanu

AP Atanu Podder September 6, 2005 06:14 AM UTC

Just a reminder... A reply is still awaited ...

Live Chat Icon For mobile
Up arrow icon