Jump to content
Software FX Community

Pie Chart


retrospect

Recommended Posts

Super simple for someone other than me.  When using database view (or query) of two numerical values I want to show in the SAME pie chart depicting license usage, the gadget actually shows up as two seperate pie charts.  Driving me insane.  What am I missing?

 

Statement: SELECT * FROM qryTestOutput: TotalLicences = 12     InUse = 3

 

Outcome: two pie charts, not showing expected single pie chart made of 12 units of which 3 licenses are consumed 

 

Link to comment
Share on other sites

The default behavior of our chart control is to use columns in your SQL (or properties if you bind to a powershell script that returns objects) as series and records (or objects in powershell) as points.

This works most of the time, e.g. if you select 2 columns and receive 10 records in your SQL and create a line chart you will get 2 lines  with 10 points each, I am afraid you found a simple case where our default does not work as well. In a pie chart with only one point we should have automatically transposed this data resulting in a chart with 1 series and 2 points so that you would get a single pie composed of 2 slices.

If you are creating your chart in the command line/script you should be able to do the following

invoke-sql ..... | out-chart -datasourcesettings_style +transpose -gallery pie

Unfortunately there is no way to achieve this if you are using the PowerGadgets creator. We understand this a common scenario so we added a menu item that allows you to transpose the data. This will be included in our next service pack, if you want to test this functionality before the service pack is released please drop an email to support at powergadgets dot com.

JuanC

PS: Note that we treat all slices in a pie chart as parts of the whole, you will have to modify your SQL so that it returns 9 and 3, we will then add them up (12) and show that InUse is 25% of the total.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...