Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Custom DataPoint Symbol

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
jerzy 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?

Thanks

Jerzy
2   L A T E S T    R E P L I E S    (Newest First)
jerzy Posted - 14 Aug 2016 : 15:09:35
Dear Q-C,

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.

Jerzy
quinncurtis 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);
return result;
}

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);
attrib3.SetFillColor (Color.Red);
attrib3.SetFillFlag (false);
attrib3.SetSymbolSize(16);

SimpleScatterPlot thePlot3 = new SimpleScatterPlot(pTransform1, Dataset3, ChartObj.CIRCLE, attrib3);

ChartSymbol customSymbol = new ChartSymbol();
customSymbol.SetSymbolShape(GetCustomShape());

thePlot3.SetCustomScatterPlotSymbol(customSymbol);

chartVu.AddChartObject(thePlot3);

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07