Solved

WebChart.Dll

Posted on 2006-11-03
1
1,207 Views
Last Modified: 2008-01-09
hello, im using wecharts by www.carlosag.net

i need to know if there is a way to adjust Legend's height?

im using this code. the legend is way too tall


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim wcEng As New ChartEngine
        wcEng.Size = New Size(500, 350)
        Dim wcCharts As New ChartCollection(wcEng)
        wcEng.Charts = wcCharts
        wcEng.HasChartLegend = true
        wcEng.Legend.Position = LegendPosition.Bottom
        Dim slChart As New LineChart()
        slChart.Line.Color = Color.Red
        slChart.Legend = "Watts"
        slChart.ShowLineMarkers = False
        slChart.ShowLegend = True
        slChart.Data.Add(New ChartPoint("One", 12))
        slChart.Data.Add(New ChartPoint("Two", 22))
        slChart.Data.Add(New ChartPoint("Three", 2))
        wcCharts.Add(slChart)
        SetMoreProperties(wcEng,"Sell v. Buy","Period","Price ($)")
        Dim bmp As Bitmap
        Dim memStream As New System.IO.MemoryStream
        bmp = wcEng.GetBitmap()
        bmp.Save(memStream, System.Drawing.Imaging.ImageFormat.Png)
        memStream.WriteTo(Response.OutputStream)
        Response.ContentType = "image/png"
        Response.End()
        ' End If
    End Sub


    Private Sub SetMoreProperties(ByVal engine As ChartEngine,byval Title as string,byVal XTitle as string,byval YTitle as string)
        Dim myFont As New System.Drawing.Font("Tahoma", 9,FontStyle.Bold)
        engine.XTitle = New ChartText
        Dim horizontalFormat As New StringFormat
        horizontalFormat.LineAlignment = StringAlignment.Center
        horizontalFormat.Alignment = StringAlignment.Center
        engine.XTitle.StringFormat = horizontalFormat
        engine.XTitle.Text = XTitle
        engine.XTitle.Font = myFont

        ' Set-up the YTitle
        engine.YTitle = New ChartText
        engine.YTitle.Font = myFont
        Dim verticalFormat As New StringFormat
        verticalFormat.FormatFlags = StringFormatFlags.DirectionVertical
        verticalFormat.Alignment = StringAlignment.Center
        verticalFormat.LineAlignment = StringAlignment.Center
        engine.YTitle.StringFormat = verticalFormat
        engine.YTitle.Text = YTitle

        ' Set-up the Title
        engine.Title = New ChartText
        engine.Title.Text = Title
        engine.Title.Font = myFont
       

        ' Specify show XValues
        engine.ShowXValues = True
        engine.ShowYValues = True

        ' Some padding
        engine.Padding = 10
        engine.ChartPadding = 35

        ' some color
        engine.Background.Color = Color.FromArgb(70, Color.DarkBlue)

        ' some color
        engine.PlotBackground.Color = Color.LightYellow
    End Sub
0
Comment
Question by:dynamicrevolutions
1 Comment
 
LVL 10

Accepted Solution

by:
Kinger247 earned 500 total points
ID: 17865112
Looks like the legends size is in camparison to the size of the control.

If it doesn't do what you intend can you know search for another ?

Mind you, other charting controls I've used in the past work in a simliar way.
Don't know if anyone else can point out one where the legend size can be amended...
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question