Create Gantt Chart in Winfoms C# - c#

I am trying to create a kind of Gantt Chart in Winfoms (I can consider to do in Wpf) which should display data as the following image:
Until now I had been try to do it using gridView, which is close to the wanted result but I have not been able to get the vertical line:
There is any way to have this vertical line over the gridView or even a better way to achieve this desired result (picture 1)?

Have you seen these open-source solutions:
[1] &
[2]
I think it's better not to reinvent the wheel!
More solutions could be as the following:
MS Project Gantt chart control usage in C#
Gantt Chart
I think this one is not open source

Related

embed a button into an excel chart

Roughly speaking, I want to create a child class from Excel Chart to add the following features into the child:
add a button to the visual appearance of the chart (the button should have a fixed position relatively to the chart - so if I move chart, the button moves as well). Actually, it doesn't have to be exactly button - it may be anything else which allows clicking on it (or do any other action) and do some activities after the click.
add some additional properties to the chart (these properties doesn't appear vizually but they influence the representation of the time-series). Maybe there is a standard way to customize the set of the properties of Excel Chart?
I don't know to what extent it is possible. Maybe "child class" is not that good idea to serve such simple needs. Maybe VSTO has something, but I can't find anything suitable in the Internet.
Any help will be very much appreciated!
PS
For the subquestion #2 I've decided to use the field TAG to put there an object with additional parameters.
In answer to your first question it is possible to embed a form-control button or a shape in a chart, and have it keep its position relative to the chart area, by cutting and pasting it onto the chart. Use the OnAction property to assign a procedure to the button.
Recorded code (in Excel) is like this:
Sub Macro1()
ActiveSheet.Buttons.Add(166.5, 48, 48, 32.25).Select
Selection.OnAction = ActiveWorkbook.Name & "!TestMacro"
Selection.Cut
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Paste
Selection.ShapeRange.IncrementLeft 10
Selection.ShapeRange.IncrementTop 30
End Sub
It may be possibly to do this programmatically without cutting and pasting, perhaps by adding to the ChartObject's ShapeRange, but I haven't explored this.
I do not know to what extent you can directly subclass an Excel Chart (if at all) and suspect that you might just create a wrapper class for it in C#.

Draw custom marker on WPF Toolkit Chart

I have simple (x,y) graph using WPF Toolkit DataVisualisation Chart.
This is Area chart but could be line or box.
I need to show on the chart - which data point was updated last. I'd like to draw a line or show a thick gridline for that data point.
What can be done to achieve it?
I had to change code in the toolkit classes. after 4 hours of getting throught the khaos of the inheritance I finally made by adding some code into : OrientedAxisGridLines (to draw the line), LinearAxis (to calculate pixel position for the line), DataPointSeriesWithAxes (to have dep prop to bind to the user data).
The code is awkward and is written to get job done so I am not sharing it.
If there will be those who wants to see it - leave the comment I might do it later...

Inserting a striped line onto an Excel chart through COM Interop

How can we add a striped line to an Excel chart using C#?
I am able to create the chart using c# but I didn't get any clue how to add a striped line.
Please make some suggestions.
Thanks
Try this:
- add a data series with a steady value ( of 50 in your case )
- move the new data series to the secondary Y axis
- synchronize the maximum for both Y axes
- set Chart Type for the new data series to Line
- set the Line Style for the new data series to a dash type
I know this is not C#, but it is C# as much as you question is :)
When I have things like this, what I'm usually doing is I "manually" do all I have to do in Excel recording a macro with all the stuff. Then I just analyze the macro. You will find a lot of useful information there.
Good luck!

How can I create multiple chart areas on ms chart or ... c#

Hello I need to make a chart like this :
http://www.xe.com/currencycharts/?from=USD}&to=EUR
Should I use 2 chart areas or just create 2 charts
Any idea how can I accomplish this?
Thanks!
i created 2 charts with same series a small one and a big one selecting on big one zoomes on the small one

Format Excel Chart Background using C#

I can already populate the data into the spreadsheet, create the chart based on the range I select. However, when it comes to formatting the actual chart I feel a bit lost as their are so many options!!
It is an xlCylinderBarStacked type chart. I simply need to make the color of the bars a nice light orange and make the background a light blue fading into white at the bottom.
Any idea's how to do this?
Just to close this question off. I played around a little with the properties and the following achieved the gradient effect on the background of the chart.
xlChart.Interior.Color = ColorTranslator.ToOle(Color.LightSkyBlue);
chart.ChartArea.Fill.TwoColorGradient(
Microsoft.Office.Core.MsoGradientStyle.msoGradientHorizontal,
1);
One good trick with Excel and other VBA-enabled apps is to manually create the formatting/content you require using the Excel GUI, whist recording a 'macro'. Once this is done you can then inspect the generated VBA to see how to use the API to acheive the same results programmatically. You will of course have to do some translation from VBA to C# but essentially the same methods should work.

Categories

Resources