|T O P I C R E V I E W
||Posted - 12 Aug 2016 : 22:55:09
Hello forum members,
I am creating pump performance line plots. Many people in this industry use what looks like an inverted "L" to mark the design point instead of the triangles, stars, plusses, etc that are standard data point symbols in QCChart2D. Is there a way to create custom data point symbols? I have been experimenting with chart images and chart text objects. but have trouble getting the vertex of the symbol to coincide with the exact datapoint---my symbol usually ends up offset from datapoint location. Is there a way to create a custom data point symbol?
|2 L A T E S T R E P L I E S (Newest First)
||Posted - 14 Aug 2016 : 15:09:35
Thank you so much! Worked perfectly. I am continually impressed with the quick and effective replies you give to questions. I pay well for support for some engineering programs and do not get the help you give for free. I have several of your packages and look to buy more. Again thanks and best regards to you and your fine company.
||Posted - 13 Aug 2016 : 12:26:45
Yes, you can create a custom shape. In general the symbol shapes are centered around the point (0.5, 0.5) in a symbol normalized coordinate system. The point in the symbol corresponding to (0.5, 0.5) is going to match the data point.
Define a simple custom shape class in you program, returning a GraphicsPath. The example below creates an inverted, left pointing, L. Since it is not closed, you should not try and fill it.
public GraphicsPath GetCustomShape()
GraphicsPath result = new GraphicsPath();
result.AddLine(1.0f, 0.5f, 0.5f, 0.5f);
result.AddLine(0.5f, 0.5f, 0.5f, 1.5f);
Then create a custom ChartSymbol using your custom shape. Set the SetCustomScatterPlotSymbol property of the SimpleScatterPlot object with the custom symbol.
ChartAttribute attrib3 = new ChartAttribute (Color.Red, 1,DashStyle.Solid);
SimpleScatterPlot thePlot3 = new SimpleScatterPlot(pTransform1, Dataset3, ChartObj.CIRCLE, attrib3);
ChartSymbol customSymbol = new ChartSymbol();