Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WebChart.Dll

Posted on 2006-11-03
1
Medium Priority
?
1,238 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

773 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