Go Back   DeveloperBarn Forums > Programming & Scripting > .Net Development

Sponsored Links

Discuss "WebCharts Control" in the .Net Development forum.

.Net Development - Learn about the Microsoft.Net framework and how to create powerful web-based (ASP.net) and client-based (Windows Forms) applications utilizing various languages such as C#, VB.Net, J# and others.


Closed Thread « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old April 4th, 2008, 11:05 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default WebCharts Control

Has anyone got any experience of this WebChart Control?
WebChart Control for ASP.NET

I've tried the example on the site but all I get is a no image Red X. When I check the source, no src file is added to the <img> tag and when I check the WebCharts folder, where the graph image should be stored, it's empty.

I've contacted my host to check on permissions, but I don't think it's a permissions problem.

Can anyone confirm if this control works with 2.0. I believe it should do, but I've no idea why mine isn't working.

Any ideas?
webchart.aspx
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="webchart.aspx.vb" Inherits="webchart_page" %>
<%@ Register TagPrefix="webchart" Namespace="WebChart" Assembly="WebChart" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="XHTML namespace" >
<head runat="server">
    <title>Web Chart</title>
</head>
<body>
    <form id="form1" runat="server">
    <webchart:ChartControl ID="test_chart" Width="500" Height="350" ChartFormat="Jpg" runat="server" />
    </form>
</body>
</html>
webchart.aspx.vb
Code:
Imports System.Drawing
Imports System.Data
Imports MySql.Data.MySqlClient
Imports WebChart
 
Partial Class webchart_page
    Inherits System.Web.UI.Page
    Sub Page_Load()
        Dim ds As DataSet = GetDataSet()
        Dim view As DataView = ds.Tables(0).DefaultView
        Dim chart As New SmoothLineChart()
        chart.Line.Color = Color.SteelBlue
        chart.Legend = "Value 1"
        chart.DataSource = view
        chart.DataXValueField = "Description"
        chart.DataYValueField = "Value1"
        chart.DataBind()
        test_chart.Charts.Add(chart)
        Dim chart1 As New SmoothLineChart()
        chart1.Line.Color = Color.Red
        chart1.Legend = "Value 2"
        chart1.DataSource = view
        chart1.DataXValueField = "Description"
        chart1.DataYValueField = "Value2"
        chart1.DataBind()
        test_chart.Charts.Add(chart1)
        ConfigureColors()
        test_chart.RedrawChart()
    End Sub
    Private Function GetDataSet() As DataSet
        Dim ds As New DataSet()
        Dim table As DataTable = ds.Tables.Add("Data")
        table.Columns.Add("Description")
        table.Columns.Add("Value1", GetType(Integer))
        table.Columns.Add("Value2", GetType(Integer))
        Dim rnd As New Random()
        Dim i As Integer
        For i = 0 To 20
            Dim row As DataRow = table.NewRow()
            row("Description") = i.ToString()
            row("Value1") = rnd.Next(100)
            row("Value2") = rnd.Next(100)
            table.Rows.Add(row)
        Next
        Return ds
    End Function
    ' Configure some colors for the Chart, this could be done declaratively also
    Sub ConfigureColors()
        test_chart.Background.Color = Color.DarkGray
        test_chart.Background.Type = InteriorType.Hatch
        test_chart.Background.HatchStyle = System.Drawing.Drawing2D.HatchStyle.DiagonalBrick
        test_chart.Background.ForeColor = Color.Yellow
        test_chart.Background.EndPoint = New Point(500, 350)
        test_chart.Legend.Position = LegendPosition.Left
        test_chart.Legend.Width = 80
        test_chart.YAxisFont.ForeColor = Color.Red
        test_chart.XAxisFont.ForeColor = Color.Green
        test_chart.ChartTitle.Text = "WebChart Control Sample"
        test_chart.ChartTitle.ForeColor = Color.DarkBlue
        test_chart.Border.Color = Color.SteelBlue
        test_chart.BorderStyle = BorderStyle.Ridge
    End Sub
 
End Class

Last edited by richyrich; May 6th, 2008 at 11:36 AM. Reason: Removed [SOLVED] from title
Sponsored Links
  #2  
Old April 4th, 2008, 11:14 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

It's OK. I found the problem.

When I created the webform using VWD, it added AutoEventWireUp="false" into my page. I removed this and it worked fine.

Sorry to have bothered you all!!
Closed Thread

  DeveloperBarn Forums > Programming & Scripting > .Net Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -4. The time now is 07:43 PM.



Content Relevant URLs by vBSEO 3.2.0