.NET Charts Graph for Mobile Application

Last post 06-29-2009 12:46 AM by abcplex. 4 replies.

Sort Posts:

  • .NET Charts Graph for Mobile Application

    06-24-2009, 8:04 AM
    • Member
      6 point Member
    • abcplex
    • Member since 03-18-2009, 12:51 AM
    • Posts 41

    I have Search a Lot but there is no material found about charting in .NET Mobile.

    Is there is no ASP.NET Mobile Charting  Tool Or Component avialable.

     I hava found for windows, but i need it for asp.net Mobiles that are render in Mobile Phone

  • Re: .NET Charts Graph for Mobile Application

    06-25-2009, 1:24 AM
    • Member
      6 point Member
    • abcplex
    • Member since 03-18-2009, 12:51 AM
    • Posts 41

    Any Ideas? 

  • Re: .NET Charts Graph for Mobile Application

    06-25-2009, 8:27 AM
    • Member
      6 point Member
    • abcplex
    • Member since 03-18-2009, 12:51 AM
    • Posts 41

    Edit

  • Re: .NET Charts Graph for Mobile Application

    06-26-2009, 8:00 AM
    Answer
    • All-Star
      17,505 point All-Star
    • imran_ku07
    • Member since 06-04-2008, 1:21 PM
    • KARACHI, PAKISTAN
    • Posts 3,205

    I use built in ASP:Chart in Mobile Form and it work's,

    For Example there two pages,

    Default.aspx is Normal Page
    Default2.aspx is Mobile Page
    Note this,

    <mobile:Image ImageUrl="Default.aspx" ID="Image1" Runat="server">

    ImageUrl Set to Default.aspx.cs

    This is the Mobile Form Default2.aspx,

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
    <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <body>
    
    <mobile:Form id="Form1" runat="server">
    <mobile:Image ImageUrl="Default.aspx" ID="Image1" Runat="server">
    </mobile:Image>
        <mobile:ObjectList id="ObjectList1" LabelStyle-Font-Size="Small" LabelStyle-Font-Bold="False" Font-Size="NotSet" runat="server" TableFields="RoomNo;RoomType;RoomCost"
            AutoGenerateFields="false">
            <Field  Title="Number" DataField="RoomNo"></Field>
            <Field Title="Type" DataField="RoomType"></Field>
            <Field Title="Cost" DataField="RoomCost"></Field>
        </mobile:ObjectList>    
    </mobile:Form>   
    
    </body>
    </html>




    in Page Load Default.aspx.cs


    Bitmap image = new Bitmap(300, 50);
            Graphics g = Graphics.FromImage(image);
            System.Web.UI.DataVisualization.Charting.Chart Chart2 = new System.Web.UI.DataVisualization.Charting.Chart();
            Chart2.Width = 412;
            Chart2.Height = 296;
            Chart2.RenderType = RenderType.ImageTag;
            Chart2.Palette = ChartColorPalette.BrightPastel;
            Title t = new Title("IMG source streamed from Controller", Docking.Top, new System.Drawing.Font("Trebuchet MS", 14, System.Drawing.FontStyle.Bold), System.Drawing.Color.FromArgb(26, 59, 105));
            Chart2.Titles.Add(t);
            Chart2.ChartAreas.Add("Series 1");
            // create a couple of series   
            Chart2.Series.Add("Series 1");
            Chart2.Series.Add("Series 2");
            // add points to series 1   
            
            Chart2.Series["Series 1"].Points.AddY(10);
            Chart2.Series["Series 1"].Points.AddY(1);
            Chart2.Series["Series 1"].Points.AddY(2);
            Chart2.Series["Series 1"].Points.AddY(10);
            // add points to series 2   
    
            Chart2.Series["Series 2"].Points.AddY(10 + 1);
            Chart2.Series["Series 2"].Points.AddY(1+ 1);
            Chart2.Series["Series 2"].Points.AddY(2+ 1);
            Chart2.Series["Series 2"].Points.AddY(10+ 1);
    
            Chart2.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
            Chart2.BorderlineWidth = 2;
            Chart2.BorderColor = System.Drawing.Color.Black;
            Chart2.BorderlineDashStyle = ChartDashStyle.Solid;
            Chart2.BorderWidth = 2;
            Chart2.Legends.Add("Legend1");
            MemoryStream imageStream = new MemoryStream();
            Chart2.SaveImage(imageStream, ChartImageFormat.Png);
    
            Response.ContentType = "image/png";
            imageStream.WriteTo(Response.OutputStream);
            g.Dispose();
            image.Dispose();        
    
        }


  • Re: .NET Charts Graph for Mobile Application

    06-29-2009, 12:46 AM
    • Member
      6 point Member
    • abcplex
    • Member since 03-18-2009, 12:51 AM
    • Posts 41

    It work's.

     Really Thanks

Page 1 of 1 (5 items)