Solved

WebChart.Dll

Posted on 2006-11-03
1
1,202 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

10 Experts available now in Live!

Get 1:1 Help Now