Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Frank Cazabon
  Where is Frank Cazabon?
 
 Trinidad And Tobago
 Frank Cazabon
 To: Koen Piller
  Where is Koen Piller?
 Santpoort-Zuid
 Netherlands
 Koen Piller
 Tags
Subject: RE: Exploded Pie Chart in FoxCharts
Thread ID: 365530 Message ID: 365603 # Views: 68 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: 3rd Party Software
Date: Friday, December 28, 2012 1:11:12 PM         
   


> > Hi,
> >
> > I am trying to create an exploded pie chart (where all the pie pieces are separated from each other) using FoxCharts 1.20 but not having any luck. Anyone can see what I am doing wrong?
> >
> >
> > LPARAMETERS toWord, toDoc, tcFileName
> > 
> > m.lcChartFile = FORCEEXT(m.tcFileName + "-Expense", "PNG")
> > 
> > LOCAL loFoxChart as FoxCharts OF "FoxCharts.vcx"
> > m.loFoxChart = NEWOBJECT("FoxCharts", "FoxCharts.vcx")
> > 
> > CREATE CURSOR c_Chart (nValue n(8,2) null, Legend c(30), Color i, Detach l, Hide l)
> > INSERT INTO c_Chart ;
> > SELECT ExpenseAmount, typ_name, 0, .T., .F. FROM c_ExpenseBreakdown order by ExpenseAmount desc 
> > 
> > GO TOP IN c_Chart
> > replace detach WITH .F. IN c_Chart
> > 
> > WITH m.loFoxChart as FoxCharts OF "FoxCharts.vcx"
> > 	.Width = oAppInfo.ChartWidth *100
> > 	.Height = oAppInfo.ChartHeight *100
> > 	.PieDetachPixels = 50
> > 	
> > 	* 1st step is to tell the class how many columns with data will be used
> > 	.ChartsCount = 1
> > 
> > 	.ChartType = 1
> > 	
> > 	.Depth = 30 && the 3D effect - 0 = plain chart
> > 
> > 	* Inform the class where the data will be found
> > 	.SourceAlias = "c_Chart"
> > 	.FieldAxis2  = "Legend" && name of the field
> > *	.FieldColor = "Color" && name of the field - used when you choose custom colors
> > 	.FieldLegend = "Legend" && name of the field
> > 
> > 	.Fields(1).FieldValue = "nValue"
> > 
> > 	* Setting the captions for the other legends
> > 	.Title.Caption = "Claims Expense Breakdown"
> > 	.Subtitle.Caption = ""
> > 	.YAxis.Caption = "Amount Loaned" && used in charts that contain axes, otherwise ignored
> > 	.XAxis.Caption = "Year" && used in charts that contain axes, otherwise ignored
> > 
> > 	* The backcolor
> > 	.BackColor = RGB(0,0,0) && black
> > 	
> > 	* Setting the colors
> > 	.ColorType = 2 && 0=basic, 1=custom, 2=Random colors
> > 	
> > 	.Title.ForeColor = RGB(255,255,255)
> > 	.SideLegend.ForeColor = RGB(255,255,255)
> > 	.ShowValuesOnShapes = .T.
> > 	.LegendPosition = 8
> > 
> > 	.DrawChart() && update the chart with the current settings
> > 	
> > 	.SaveToFile(m.lcChartFile, 100)
> > ENDWITH
> > 
> > this.AddChartToWord(m.toWord, m.toDoc, "ExpenseChart", m.lcChartFile)
> > 
> > RETURN 
> > 
> > 

> >
> > Frank.
> >
> > Frank Cazabon
> > Samaan Systems Ltd.
> > www.SamaanSystems.com
>
> Frank,
>
> FoxCharts, does not have an explicit property to present an exploded chart, but you could easily mimic it. There is an option to explode a pie or donut slice, the 'explosion' is activated by either a the method PieDetachSliceOnClick or the method PieDetachSliceonLegendClick. So you must invoke either method on each and every slice. In which case you can end up with something like picture attached:
>
>
>
>
> Please report back if you need further assistance.
>
> Regards,
>
> Koen

Thanks Koen,

the pie chart I am producing is done completely invisible to the end user so they will not be able to click on the slices manually. How would I invoke the call to the method on each slice programatically?

Frank.

Frank Cazabon
Samaan Systems Ltd.
www.SamaanSystems.com

ENTIRE THREAD

Exploded Pie Chart in FoxCharts Posted by Frank Cazabon @ 12/27/2012 6:01:53 PM
RE: Exploded Pie Chart in FoxCharts Posted by Koen Piller @ 12/28/2012 11:39:07 AM
RE: Exploded Pie Chart in FoxCharts Posted by Frank Cazabon @ 12/28/2012 1:11:12 PM
RE: Exploded Pie Chart in FoxCharts Posted by Koen Piller @ 12/28/2012 6:18:52 PM
RE: Exploded Pie Chart in FoxCharts Posted by Frank Cazabon @ 12/28/2012 9:42:45 PM
RE: Exploded Pie Chart in FoxCharts Posted by Koen Piller @ 12/28/2012 11:18:08 PM
RE: Exploded Pie Chart in FoxCharts Posted by Frank Cazabon @ 12/29/2012 5:37:48 PM
RE: Exploded Pie Chart in FoxCharts Posted by Koen Piller @ 12/30/2012 5:29:56 PM
RE: Exploded Pie Chart in FoxCharts Posted by Frank Cazabon @ 12/31/2012 12:36:33 PM
RE: Exploded Pie Chart in FoxCharts Posted by Koen Piller @ 12/31/2012 2:40:20 PM
RE: Exploded Pie Chart in FoxCharts Posted by Koen Piller @ 7/1/2013 3:11:56 PM
RE: Exploded Pie Chart in FoxCharts Posted by Frank Cazabon @ 7/1/2013 3:52:44 PM
RE: Exploded Pie Chart in FoxCharts Posted by Cesar @ 7/1/2013 3:47:40 PM
RE: Exploded Pie Chart in FoxCharts Posted by Frank Cazabon @ 7/1/2013 3:51:11 PM
RE: Exploded Pie Chart in FoxCharts Posted by Koen Piller @ 7/1/2013 6:59:55 PM
RE: Exploded Pie Chart in FoxCharts Posted by Cesar @ 7/1/2013 8:59:58 PM
RE: Exploded Pie Chart in FoxCharts Posted by Frank Cazabon @ 7/1/2013 9:23:34 PM
RE: Exploded Pie Chart in FoxCharts Posted by Koen Piller @ 7/2/2013 3:54:26 AM