Click here to Skip to main content
15,914,642 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: PNG images not pulling through in IIS Pin
Andras Fuchs15-Sep-09 0:03
Andras Fuchs15-Sep-09 0:03 
Questioncannot detect User Control Pin
sameercodes5-May-09 23:01
sameercodes5-May-09 23:01 
AnswerRe: cannot detect User Control Pin
Spunky Coder5-May-09 23:28
Spunky Coder5-May-09 23:28 
QuestionVirtual Earth Bespoke Map Control help!!!! Pin
Lexter33335-May-09 22:36
Lexter33335-May-09 22:36 
QuestionHow would you create this? Pin
Mantaii5-May-09 22:35
Mantaii5-May-09 22:35 
AnswerRe: How would you create this? Pin
Mantaii6-May-09 23:48
Mantaii6-May-09 23:48 
QuestionFlash in PDF issue Pin
Abhishek Sur5-May-09 22:28
professionalAbhishek Sur5-May-09 22:28 
QuestionCharts in .NET Pin
liz35-May-09 21:51
liz35-May-09 21:51 
Hello,
I need to generate a few charts based on data stored in my database on SQL Server. I had no idea of how to generate charts with standard values itself.A little search on the Internet gave me the following code which works well:

Dim Image As New Bitmap(500, 300, PixelFormat.Format32bppRgb)
Dim g As Graphics = Graphics.FromImage(Image)
Dim redPen As New Pen(Color.Red, 10)
Dim blueBrush As New SolidBrush(Color.Blue)
Dim myImage As Bitmap


Dim p() As Integer = {1000000, 600000, 2500000, 80000}


Dim towns() As String = {"A", "B", "C", "D"}

Dim myBrushes(4) As Brush
myImage = New Bitmap(500, 300, PixelFormat.Format32bppRgb)
g = Graphics.FromImage(myImage)

' Create the brushes for drawing
myBrushes(0) = New SolidBrush(Color.Red)
myBrushes(1) = New SolidBrush(Color.Blue)
myBrushes(2) = New SolidBrush(Color.Yellow)


myBrushes(3) = New SolidBrush(Color.Green)


' Variables declaration
Dim i As Integer
Dim xInterval As Integer = 100
Dim width As Integer = 90
Dim height As Integer
Dim blackBrush As New SolidBrush(Color.Black)

For i = 0 To p.Length - 1
height = (p(i) \ 10000) ' divide by 10000 to adjust barchart to height of Bitmap

' Draws the bar chart using specific colours
g.FillRectangle(myBrushes(i), xInterval * i + 50, 280 - height, width, height)

' label the barcharts
g.DrawString(towns(i), New Font("Verdana", 12, FontStyle.Bold), Brushes.Black, xInterval * i + 50 + (width / 3), 280 - height - 25)

' Draw the scale
g.DrawString(height, New Font("Verdana", 8, FontStyle.Bold), Brushes.Black, 0, 280 - height)

' Draw the axes
g.DrawLine(Pens.Brown, 40, 10, 40, 290) ' y-axis
g.DrawLine(Pens.Brown, 20, 280, 490, 280) ' x-axis
Next
myImage.Save(Response.OutputStream, _
System.Drawing.Imaging.ImageFormat.Jpeg)

But now i need to know how in the p() array I can input values from the database dynamically i.e the number of values in the database could vary with time.The code should automatically input all the values in the table in the databse and generate the appropriate chart.How do i do this?
QuestionEntity Layer: Structure vs Class Pin
Anurag Gandhi5-May-09 21:50
professionalAnurag Gandhi5-May-09 21:50 
AnswerRe: Entity Layer: Structure vs Class Pin
Spunky Coder5-May-09 22:06
Spunky Coder5-May-09 22:06 
QuestionCrystal Report on Web Server Pin
yogesh_kumar_agarwal5-May-09 21:45
yogesh_kumar_agarwal5-May-09 21:45 
AnswerRe: Crystal Report on Web Server Pin
Dinesh Reghunath5-May-09 23:59
professionalDinesh Reghunath5-May-09 23:59 
GeneralRe: Crystal Report on Web Server Pin
yogesh_kumar_agarwal6-May-09 0:15
yogesh_kumar_agarwal6-May-09 0:15 
GeneralRe: Crystal Report on Web Server Pin
Dinesh Reghunath6-May-09 0:50
professionalDinesh Reghunath6-May-09 0:50 
QuestionAjax Timer control in ASP.Net Pin
scothykonma5-May-09 21:17
scothykonma5-May-09 21:17 
AnswerRe: Ajax Timer control in ASP.Net Pin
Spunky Coder5-May-09 21:51
Spunky Coder5-May-09 21:51 
GeneralRe: Ajax Timer control in ASP.Net [modified] Pin
scothykonma6-May-09 0:32
scothykonma6-May-09 0:32 
Questionhow to implement time interval in asp.net Pin
souravghosh185-May-09 20:52
souravghosh185-May-09 20:52 
AnswerRe: how to implement time interval in asp.net Pin
Abhishek Sur5-May-09 22:22
professionalAbhishek Sur5-May-09 22:22 
GeneralRe: how to implement time interval in asp.net Pin
souravghosh185-May-09 22:41
souravghosh185-May-09 22:41 
Questionexponential to float value Pin
Member 38798815-May-09 20:33
Member 38798815-May-09 20:33 
QuestionLoading image in textbox(auto complete extender) Pin
md_azy5-May-09 19:52
md_azy5-May-09 19:52 
AnswerRe: Loading image in textbox(auto complete extender) Pin
Spunky Coder5-May-09 20:03
Spunky Coder5-May-09 20:03 
AnswerRe: Loading image in textbox(auto complete extender) Pin
Abhijit Jana5-May-09 20:11
professionalAbhijit Jana5-May-09 20:11 
AnswerRe: Loading image in textbox(auto complete extender) Pin
Bangla Gopal Surya Prakash29-Jun-09 21:32
Bangla Gopal Surya Prakash29-Jun-09 21:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.