ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Rotating a Meter chart...
Posted by Patrick on Jan-25-2015 12:53
I am attempting to rotate a chart like this...

    ' output the chart
    Response.ContentType = "image/png"
    m.makeChart3().rotate(-90.0)
    Response.BinaryWrite(m.makeChart2(Chart.PNG))
    Response.End()

However, I get the following error:

[IndexOutOfRangeException: Index was outside the bounds of the array.]
   ChartDirector.DrawArea.rotate(Double angle, Int32 bgColor, Double cx, Double cy,
Int32 ft, Double blur) +2679
   ChartDirector.DrawArea.rotate(Double angle) +62
   ASP.reports_pdt_eiq_vert_aspx.__Render__control1(HtmlTextWriter __w, Control
parameterContainer) in
C:\\Users\\Pat\\Documents\\dev.leadingdimensions.com\\reports\\PDT\\EIQ-vert.aspx:56
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection
children) +268
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter
adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
+100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +1386


It's as if I'm attempting to access an array with the degrees argument in rotate()

Thank you!

  Re: Rotating a Meter chart...
Posted by Patrick on Jan-25-2015 13:05
I also tried:

    Dim dw As ChartDirector.DrawArea = m.getDrawArea()
    dw.rotate(-90.0, &HFFFFFF, -1, -1, Chart.LinearFilter, 1)

    ' output the chart
    Response.ContentType = "image/png"
    Response.BinaryWrite(m.makeChart2(Chart.PNG))
    Response.End()

and got the same error message.

Thanks!

  Re: Rotating a Meter chart...
Posted by Patrick on Jan-25-2015 13:21
Now this worked:

m.makeChart3().rotate(89.999999999, &HFFFFFF, -1, -1, Chart.LinearFilter, 1)

But if I use 90.0 as the degrees, I get the index out of range error shown above.

Am I doing something wrong?

Pat

  Re: Rotating a Meter chart...
Posted by Peter Kwan on Jan-27-2015 02:57
Hi Patrick,

This is in fact due to a bug in ChartDirector which occurs when rotating by -90 degrees.

ChartDirector has special optimization code for certain rotation angles, like, 0, 90, 180, 270
(-90 is the same as 270). We have just discovered there is a bug in the optimization for 270
degrees, causing the problem. If the angle is not -90 (such as -89.99), then the
optimization is not used and so it does not occur.

We will fix this in next version of ChartDirector. In the meantime, I suggest to use -89.9999
for that rotation angle.

Regards
Peter Kwan