Timeline\gantt control in winforms approach - winforms

I want to create a control that shows a list of activities like in a gantt chart in winforms.
I don't want to use any of the non official products out there.
The diagram will have to:
Show the activities as rectangles of different colors. each activity have a start and an end date
Show an X-axis for the global time line reference (years, months, days)
Allow the user to zoom in\zoom out, changing the axis accordingly
Where should I start? I first started from scratch with an empty User Control, I can easily draw rectangle as activities but the logic of the axis and the zoom-in zoom-out feature seems too complicated to build.
An alternative could be start from a chart like an horizontal histogram and on that grid and axis draw the activities.

Related

Google Data Studio Hide Data on Line Chart

Can I hide data number on line chart to make it only show the trend instead of the actual data?
To remove the Axis, switching from a Time Series Chart to a Sparkline Chart does the trick (or manually remove the required labels and Axis from the Style Tab of the Time Series Chart).
To prevent interactions with the Chart, one approach is to add a transparent Shape over the Chart.
Google Data Studio Report and a GIF to elaborate:

How to set telerik chart TrackBall position programatically

I have created a custom control which has Telerik RadCartesianChart. This custom control creates any number of charts based on user dropdown selection. The number of charts on screen can vary but all have same x axis. I added a chart track ball line on custom control which is working fine on one chart on mouse movement. I want to add the same track ball line on all of the other chart on window so that movement on one track ball would reflect the same position on the other charts.
How could I implement this behavior programmatically?
I don't know if you can do what you are attempting without adding a ChartTrackBallController to every chart.
What I'd suggest is adding multiple series to the one chart, share the X axis but have multiple Y axes as required. This way the ChartTrackBallController will pick a point on all series in the chart.
// Trackball
ChartTrackballController ctbcMain = new ChartTrackballController();
ctbcMain.TextNeeded += ctbcMain_TextNeeded;
ctbcMain.InnerPointSize = new SizeF(0, 0);
ctbcMain.OuterPointsSize = new SizeF(0, 0);
rcvUPM.Controllers.Add(ctbcMain);
rcvUPM.ShowTrackBall = true;
In the above code snippit, rcvUPM is a radchartview containing all the data series you want to show, and ctbcMain_TextNeeded is used to customise the content of what the hover for the trackball shows.
It seems that by default the hover content will contain multiple points from each series, even after the InnerPointSize and OuterPointsSize was set to zero on advice by Telerik support a LINQ FirstOrDefault was needed on the collection of DataPointInfo objects to limit it to one point per series.

How to display a background control in transparent overlapping control?

I'm building a form with two layers of controls. The bottom layer is a set of Panels with defined properties, one of which is a color different from the form background. The top layer is a set of picture boxes I'm using to display a circle. I've set the PictureBox Background to Color.Transparent, and I've offset it from the underlying Panel by one pixel to get the form to draw the underlying Panel. However, the area around the circle in the PictureBox is displaying the Form Background color, not the panel color. I don't want to draw the circle in the Panel, because I want the circles to move between Panels, and actually look like just a circle that's floating across the form independent of the Panel board underneath. Think of the effect as moving a piece on a board game (you see the peg move across the board, possibly on a diagonal not following the normal game path, then stop in a place on the game).
How can I get the PictureBox to have the underlying Form and panels show through, not just the form background color? I'm using C# Visual Studio 2010, and I'm not a terribly experienced programmer, so a code example would be helpful. An image of the form is at:
http://www.imageurlhost.com/images/salgmpcxvcz830c3flt.jpg
Found a way around the problem. I got rid of the Panels for the spaces in the game, and instead drew them as rectangles on the form's background image.

Visiblox/WPF can't zoom with series on additional Y axis

I have a Visiblox chart with multiple Y-axes, different units on each axis.
The user can click any of several buttons to display data as line series on the appropriate axis.
If the user clicks on data that plots against the primary or secondary Y-axis, it's possible to zoom the plot. If they click on data that plots on an "additional" Y-axis and there is no existing data on the primary or secondary Y-axis, the plot will not zoom.
If there is existing data plotted against the primary or secondary Y-axis, the chart zooms fine.
I'm guessing this is expected behavior in Visiblox, but am I missing any way to enable zooming with data plotted only on an "additional" Y-axis?
I know I could keep track of which axes are active and change the units on them to make sure that data is always plotted first on one of the functioning axes, but the user can also remove data from any axis at will, and I'd have to replot the data any time they removed data from the both of the functioning axes, leaving only data on the "additional" axis. Possible, but messy.
Thanks in advance!
From correspondance on the Visiblox blog, this is a known issue that will be addressed in the upcoming 2.2 release of Visiblox. Thanks to the Visiblox team for responding there!
http://www.visiblox.com/blog/2010/11/zooming-panning-in-silverlight-using-visiblox-charts

Silverlight toolkit chart too many labels on axis

I'm using the newest chart control from silverlight toolkit to plot some data. For small cases it works ok, but for bigger samples the X axis labels overlap. It would be no problem if the chart would simply omit some of the values or I could specify to just show every 10th of them ...
I couldn't find any properties providing this behavior. Any ideas?
Assuming this is a Linear axis then you can specify the interval to use via the the Interval property on the axis.
If the axis in question is Category Axis then dropping some labels may not be valuable to the user. One option is to use the LayoutTransfomer to rotate the labels to an angle reducing the width needed for each one. See this Delay Blog on the subject.

Resources