Sign In  Sign Up Live-Chat

Chart Generation (Question 3)

Last post 05-18-2008, 10:10 PM by roger. 10 replies.
Sort Posts: Previous Next
  •  05-12-2008, 2:50 AM 126449

    Chart Generation (Question 3)

    Attachment: Present (inaccessible)

    Hi Aspose.Chart Team,

    I have attached an image that shows 2 charts (the first one is the original image and the second one was generated by Aspose.Chart v3.4.6.0 from Roger).

    I made a circles and points (1 to 3) on the 2nd chart so I can ask the question more clearly.

    My questions are,

    1. in the Circle - Point number 1:  How do I hide that line? (ref to the original chart)

    2. in the Circle - Point number 2:  How do I hide the "0" value in the X-axis and make the interval value to 2 but the starting value is from 1 (i.e. 1,3,5,..,31) (ref to the original chart)

    3. in the Circle - Point number 3:  How do I extend the X-axis line? (ref to the original chart)

    This is my code:

             Dim chart As Chart = New Chart()
                Dim s As Series = New Series()

                s.ChartType = ChartType.Bar

                s.CustomAttributes.BarWidth = 5

                s.DefaultDataPoint.Color = System.Drawing.Color.FromArgb(255, 0, 0, 0)
                s.DataPoints.Add(1, 4)
                s.DataPoints.Add(2, 0)
                s.DataPoints.Add(3, 8)
                s.DataPoints.Add(4, 2)
                s.DataPoints.Add(5, 1)
                s.DataPoints.Add(6, 7.2)
                s.DataPoints.Add(7, 1)
                s.DataPoints.Add(8, 6)
                s.DataPoints.Add(9, 4.5)
                s.DataPoints.Add(10, 2.5)
                s.DataPoints.Add(11, 0.6)
                s.DataPoints.Add(12, 32)
                s.DataPoints.Add(13, 3.8)
                s.DataPoints.Add(14, 4)
                s.DataPoints.Add(15, 0)
                s.DataPoints.Add(16, 1)
                s.DataPoints.Add(17, 0)
                s.DataPoints.Add(18, 0)
                s.DataPoints.Add(19, 1)
                s.DataPoints.Add(20, 0)
                s.DataPoints.Add(21, 3)
                s.DataPoints.Add(22, 0)
                s.DataPoints.Add(23, 2.7)
                s.DataPoints.Add(24, 1.9)
                s.DataPoints.Add(25, 22)
                s.DataPoints.Add(26, 3)
                s.DataPoints.Add(27, 3.6)
                s.DataPoints.Add(28, 4.9)
                s.DataPoints.Add(29, 28)
                s.DataPoints.Add(30, 16)
                s.DataPoints.Add(31, 11.6)

                chart.ChartArea.AxisX.IsMajorGridVisible = False
                chart.ChartArea.AxisY2.IsVisible = False
               
                chart.ChartArea.AxisY.DefaultLabel.Font = New System.Drawing.Font("Arial", 6)
                chart.ChartArea.AxisX.DefaultLabel.Font = New System.Drawing.Font("Arial", 6)
                chart.ChartArea.AxisX.Title.Font = New System.Drawing.Font("Arial", 8)
                chart.ChartArea.AxisY.Title.Font = New System.Drawing.Font("Arial", 8)
                chart.ChartArea.AxisX.Title.Text = "Hours of The Day"
                chart.ChartArea.AxisY.Title.Text = "No of Calls"

                chart.ChartArea.AxisX.IsAutoCalc = False
                chart.ChartArea.AxisX.Interval = 2
                chart.ChartArea.AxisX.Minimum = 0
                chart.ChartArea.AxisX.Maximum = 31
                chart.ChartArea.AxisX.IntervalType = IntervalType.Int

                chart.ChartArea.Margin = 4
                chart.ChartArea.Transparence = 255
                chart.BackColor = System.Drawing.Color.FromArgb(255, 255, 255)
                chart.ChartArea().BackColor = System.Drawing.Color.FromArgb(255, 255, 255)
                chart.ChartArea.AxisX.Color = System.Drawing.Color.Black
                chart.ChartArea.AxisY.Color = System.Drawing.Color.Black

                chart.ChartArea.Margin = 0
                chart.ChartArea.MarginLeft = 5
                chart.ChartArea.MarginTop = 10
                chart.ChartArea.MarginRight = 5
                chart.ChartArea.MarginBottom = 2

                chart.ChartArea.AxisX.MajorTickMark.Length = 0

                chart.ChartArea.LegendBox.IsVisible = False

                chart.SeriesCollection.Add(s)

                chart.Height = 184
                chart.Width = 325

                Dim chartBitmap As Bitmap = chart.GetChartImage()

    Thank you.

    Regards,

    Jarry

     
  •  05-12-2008, 4:30 AM 126468 in reply to 126449

    Re: Chart Generation (Question 3)

    Hi Jarry,

    1.   chart.ChartArea.AxisY.MinorTickMark.IsVisible = False

    2.   Not supported. We will look into it.

    3.   Please using the version attached in Chart generation question (2) thread.

    4.   If y value is zero, draws line. This may be a bug. We will close it tomorrow.


    Roger Mo
    Developer
    Aspose Nanjing Team
    Contact Us
     
  •  05-12-2008, 5:32 PM 126571 in reply to 126468

    Re: Chart Generation (Question 3)

    Thank you very much Roger

     

    Regards,

    Jarry

     
  •  05-13-2008, 2:54 AM 126620 in reply to 126571

    Re: Chart Generation (Question 3)

    Attachment: Present (inaccessible)

    Hi Jarry,

    Please try the attached fix.

    Extending y axis grid and drawing none(y value is zero)  are possible.

    About other issue,  x axis lable values start from 1 to 31,  it is complex and  we could not supported in a short time. here is a simple solution.

                chart.ChartArea.AxisX.IsAutoCalc = False
                chart.ChartArea.AxisX.Interval = 2
                chart.ChartArea.AxisX.Minimum = 1
                chart.ChartArea.AxisX.Maximum = 31
                chart.ChartArea.AxisX.IntervalType = IntervalType.Int


    Roger Mo
    Developer
    Aspose Nanjing Team
    Contact Us
     
  •  05-13-2008, 6:24 PM 126789 in reply to 126620

    Re: Chart Generation (Question 3)

    Attachment: Present (inaccessible)

    Thank you very much Roger.

    As always, it works Great!

    it's nearlly there..

    btw, if I used the work around to hide the "0" value in the x-axis lable, the graph doesn't display properly.

    I am just wondering, do you have an ETA for solving this issue in the next version release? because I really need this graph requirement for my app production release.

    Thank you very much Roger for all your helps and supports.

    Best regards,

    Jarry

     
  •  05-13-2008, 8:58 PM 126805 in reply to 126789

    Re: Chart Generation (Question 3)

    Hi Jarry,

    Ihave added the feature to our task list. but it is complex and now i cann't tell you what time is to solving it. We will provide a new version as soon as possible that may be about a month.

    Thank you.


    Roger Mo
    Developer
    Aspose Nanjing Team
    Contact Us
     
  •  05-14-2008, 6:00 PM 127030 in reply to 126805

    Re: Chart Generation (Question 3)

    Thank you very much Roger for all your Helps.

    i'll check the updated Aspose.Chart API again in one month.

    But if you have solved it before one month, could you please let me know via email so i can test it.

    Once again, Thank you.

    Regards,

    Jarry

     
  •  05-14-2008, 8:51 PM 127056 in reply to 127030

    Re: Chart Generation (Question 3)

    Okay, if we hava solved it, i attach new version release here first and mail to you.

    Thank you.


    Roger Mo
    Developer
    Aspose Nanjing Team
    Contact Us
     
  •  05-14-2008, 11:22 PM 127075 in reply to 127056

    Re: Chart Generation (Question 3)

    Thank you Very Much Roger.

    Regards,

    Jarry

     
  •  05-16-2008, 3:47 AM 127396 in reply to 127075

    Re: Chart Generation (Question 3)

    Hi Jarry,

    I have checked Aspose.Charts source code and found a way to satisfy your requirement in current version. But the way requires us to place the code at last, otherwise there has a catastrophic error or the code does not work.

    Here's the codes:

                ......

                chart.SeriesCollection.Add(s)

                chart.Height = 184
                chart.Width = 325

                Dim i As Integer
                For i = 0 To 30 Step i + 2
                    chart.ChartArea.AxisX.AxisLabels(i).IsVisible = False
                Next

                pictureBox1.Image = chart.GetChartImage()


    Roger Mo
    Developer
    Aspose Nanjing Team
    Contact Us
     
  •  05-18-2008, 10:10 PM 127616 in reply to 127396

    Re: Chart Generation (Question 3)

    And modifys AxisX.Interval to 1

                chart.ChartArea.AxisX.IsAutoCalc = False
                chart.ChartArea.AxisX.Interval = 1
                chart.ChartArea.AxisX.Minimum = 0
                chart.ChartArea.AxisX.Maximum = 31
                chart.ChartArea.AxisX.IntervalType = IntervalType.Int


    Roger Mo
    Developer
    Aspose Nanjing Team
    Contact Us
     
View as RSS news feed in XML