Solved

WebChart.Dll

Posted on 2006-11-03
1
1,203 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Log4Net custom Appender not being fired. 5 75
Code works but how can I download the file? 20 67
Server Error 11 47
ASP.NET 5 Templates 2 66
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…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now