Jump to content
Software FX Community

JuanC

Staff
  • Posts

    863
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JuanC

  1. xmlns:cfxData="clr-namespace:ChartFX.WPF.Data;assembly=ChartFX.WPF.Data" < Page.Resources> <XmlDataProvider x:Key="myXmlData"> <x:XData> <Elems xmlns=""> <Elem Product="CocaCola" Image="pack://siteoforigin:,,,/Img/CocaCola.png" Month="Jan" Sales="12"/> <Elem Product="Pepsi" Image="pack://siteoforigin:,,,/Img/Pepsi.png" Month="Jan" Sales="10"/> <Elem Product="Pepsi" Image="pack://siteoforigin:,,,/Img/Pepsi.png" Month="Jan" Sales="1"/> <Elem Product="Pepsi" Image="pack://siteoforigin:,,,/Img/Pepsi.png" Month="Feb" Sales="8"/> <Elem Product="CocaCola" Image="pack://siteoforigin:,,,/Img/CocaCola.png" Month="Feb" Sales="14"/> <Elem Product="Pepsi" Image="pack://siteoforigin:,,,/Img/Pepsi.png" Month="Mar" Sales="9"/> <Elem Product="CocaCola" Image="pack://siteoforigin:,,,/Img/CocaCola.png" Month="Mar" Sales="13"/> <Elem Product="Sprite" Image="pack://siteoforigin:,,,/Img/Sprite.png" Month="Mar" Sales="5"/> </Elems> </x:XData> </XmlDataProvider> <DataTemplate x:Key="productTemplate"> <StackPanel Orientation="Horizontal"> <Image Source="{Binding XPath=@Image}" Width="24" Height="24"/> <TextBlock Text="{Binding XPath=@Product}" Margin="2,0" VerticalAlignment="Center"/> </StackPanel> </DataTemplate></Page.Resources>< cfx:Chart Gallery="Bar" x:Name="chart1"> <cfx:Chart.ItemsSource> <Binding Source="{StaticResource myXmlData}" XPath="Elems/Elem" /> </cfx:Chart.ItemsSource> <cfx:Chart.DataTransforms> <cfxData:CrosstabTransform RowPath="@Month" ColumnPath="@Product" ValuePath="@Sales" Sorted="true"/> </cfx:Chart.DataTransforms> <cfx:Chart.AllSeries> <cfx:AllSeriesAttributes ContentTemplate="{Binding Source={StaticResource productTemplate}}"/> </cfx:Chart.AllSeries></cfx:Chart>In this sample we are using the image in the data as part of the series content which will be shown in both tooltips and in the legendbox. Regards, JuanC
  2. JuanC

    3D Charts

    To change the camera angle you would use the View3D AngleX and AngleY properties. e.g. chart1.View3D.AngleX = 45; Note that we expose AngleX and AngleY and then calculate other camera settings to make sure as much of the scene is visible as possible. You can also create a binding, e.g. to control the angle with a slider < Slider Minimum="-90" Maximum="180" Width="120" Value="{Binding ElementName=chart1, Path=View3D.AngleX}" />Also note that View3D exposes a double property called Perspective, 0 means we use an OrthoGraphicCamera and any number between 15 and 90 will be used as the field of view of a PerspectiveCamera >> and your control seems to be the best by far. Looking forward to the final release We think once our designers prepare the different styles that will ship with the product you will be pleasantly surprised. Regards, JuanC
  3. We could not duplicate this issue with our latest build, can you please send an email to wpf at softwarefx dot com and request a hotfix. Regards, JuanC
  4. Can you tell us more about your data? e.g. what is the data type for the "Value" property? Is there anything special about the values being used? Can you duplicate this error on a standalone project? Regards, JuanC
  5. The approach using a variable is not supposed to refresh (read more about this) >> I think the object method definitely looks nicer, but I think this more-raw way may reduce the overhead. We tend to favor the object approach. This also allows you to use the same in other scripts to package information even if you are not using PowerGadgets. I think the overhead is minimal although I have not run any comparisons. >> I'm still confused as to why using the object method you pointed to wouldn't refresh. Can you please try using the object approach with gps instead of gwmi. I have seen some cases where WMI requests are not refreshed. Regards, JuanC
  6. No, this is a bug that we already fixed in our current build, please send an email to wpf at softwarefx dot com for an updated build. JuanC
  7. You can create a PGF as follows - Run the PowerGadgets creator- In the "Choose Gadget Type" screen select "Chart" and press Next- In the "Choose Data Source" screen select "Use Windows PowerShell" and press Next- Type the powershell command to retrieve the data (do not include out-chart or out-gauge) and press Finish, e.g. import C:\test.csv - Customize the chart as needed using the Chart Wizard or the property grid (Advanced Settings)- Optionally you can add other gadgets to the same PGF to create a group using "Edit - Add Item" Regards, JuanC
  8. out-chart -AxisY_LabelsFormat_Decimals 2 Regards, JuanC
  9. Invoke-WebService (or the PG Creator) was not prepared to call a method that receives an XmlDocument as a parameter. We have an internal build that adds support for this, please send an email to support at powergadgets dot com or marco's email and we should be able to provide a build for you to test early next week. Regards, JuanC
  10. To disable this behavior please add -DisableAuto AddData to your out chart cmdlet invocation, e.g. C:> get-date -uformat "%S" | out-chart -refresh 0:0:1 -DisableAuto AddData Note that support for this flag was added in build 2769 JuanC
  11. If you are using the PowerGadgets creator, you will be able to plot Age, Success Percentage and Salary as you need but not the coloring depending on the region. A bubble chart requires 2 series, the first one will be used for the Position of the bubble and the second one for the size of the bubble. Additionally, it supports X values so your query should return Age,SucessPerc,Salary. If you are willing to create the gadget using a powershell script, you can use a feature implemented in a later build that allows you to write a little function that controls which conditional attribute is applied to a point. You can read more about it here. Contents of BubbleData.csv ----------------------------------------------------- Age,SuccessPerc,Salary,Role 22,45,1500,R0 25,75,2500,R1 35,53,1100,R0 42,62,1300,R2 ----------------------------------------------------- Contents of Bubble.ps1 ----------------------------------------------------- $condition = { if ($_.Role -eq "R0") { 0; } else { if ($_.Role -eq "R1") { 1; } else { 2; } } } import-csv C:\Data\BubbleData.csv | out-chart -gallery Bubble -values SuccessPerc,Salary -xvalues Age -axisY_Title_Text "Success Percentage" -axisx_Title_Text "Age" -axisy2_Visible false -axisX_Min 10 -axisX_Max 50 -axisy2_Min 0 -axisy2_Max 4000 -conditionalattributes_0_color red -conditionalattributes_1_color yellow -conditionalattributes_2_color green -condition $condition -conditionalattributes_0_text "Role 0" -conditionalattributes_1_text "Role 1" -conditionalattributes_2_text "Role 2" -legendbox_itemattributes_-series_visible false Note the following The way our axes min and max are calculated results sometimes in clipping of bubbles, for this chart I am setting the Min/Max for both the X axis and secondary Y axis used for the size of the bubbles We define as many conditional attributes as roles We assign a condition that returns a zero-based integer depending on the role field If you assign a text to your conditions they will appear in the legend box The very last parameter hides the series items from the legend box, it is a weird syntax but it works Once you have your chart running you can use a trick where with the chart gadget with the focus you press Ctrl-C, this will copy the chart's definition to the clipboard, you can then run the PG creator and pressing Ctrl-V should add a chart gadget with all the attributes. Note that this gadget will use Powershell as its data source. If you need to use data from a database you can use invoke-sql instead of import-csv Attachment shows the resulting chart. Regards, JuanC
  12. We have detected an issue where a gauge (radial, horizontal or vertical) might be saving its font even though you did not manually set it, if you designed this gadget in Vista, the font will be Segoe UI which does not exist in an XP machine. Please try opening the PGF in notepad and check if there is a reference to this font, if so please remove it and try running the gadget again. We apologize for the inconvenience. JuanC
  13. What kind of authentication are you using in your web service Windows Auth? Basic? JuanC
  14. We include a Shell Extension with PowerGadgets that adds elements to the Context menu when you right-click a PGF. In the solution we are working on, a registry entry will cause our Shell Extension to reuse P.P.exe processes when you right click and select "Open" or when you double click a PGF. Note that this is NOT a modification on our Presenter EXE so it will still be possible to run 2 presenters simultaneously but the Windows shell will reuse the existing process. We should have something ready for you to test in the next couple of days, please send an email to support at powergadgets dot com pointing to this thread so that we can get back to you. Regards, JuanC
  15. >> Launching them as 4 individual PGF files works beautifully, but results in each user running 4 instances of P.P.exe This is something we have considered doing. I can see that in a Terminal Server scenario it would be really nice to allow sharing the PP process. Because we already have a Shell Extension that handles right clicking a PGF (e.g. we show a menu with the existing Vista gadgets) we could create a registry entry to force this behavior. I think this would be the ideal solution for you as the user just needs to double click the PGFs he/she needs instead of running a super-script that creates many gadgets. >> This is not a level of memory overhead I can justify given the additional gauges we would like to deploy in the near future Note that PP is a .NET process. AFAIK .NET processes may seem to use a lot of memory if there is a plenty but under memory pressure some of that memory might be reclaimed by the system. That being said we understand using one process instead of N processes will only improve memory usage. The drawback would be that a crash in one of the gadgets will most likely result in all gadgets being closed. >> When PowerShell is allowed to launch P.P.exe it will only launch one instance per server. This is a bug caused by the method we use in PowerShell to reuse the process, I am afraid the solution although simple will have to be thoroughly tested but we can provide a hotfix if you want to test it. Regards, JuanC
  16. If by multiple lines you mean "Can I have multiple needles in a gauge" then the answer is YES. You can have multiple indicators (needles or markers in a gauge). You can also have multiple scales in a gauge. JuanC
  17. We have not tested our gadgets when using pcAnywhere but from your description it sounds like the personalization feature might be causing this. This feature allows the gadgets to remember their position and size on the desktop, in the case of the chart where you can customize the gallery, colors, etc. it also remembers these settings. Can you please try setting your gadgets to be non-personalizable by using the "Edit - Desktop Settings - Personalizable" menu item in the PG Creator? JuanC
  18. Can you check the file version for PowerGadgets.Creator.exe or PowerGadgets.Presenter.exe?Which version of SQLServer are you trying to connect? JuanC
  19. We have recently fixed this issue. You can send an email to support at powergadgets dot com to request a hotfix. Apologize for the inconvenience. JuanC
  20. Our default behavior in auto-refresh charts is to "add" points when the original source only had 1 point. We have a newer build that allows disabling this behavior both when using out-chart in powershell (-disableAuto AddData) or using the PowerGadgets creator (Data - Behavior for single Point). This feature is not yet part of our service pack but we can make it available if you want to test it. JuanC
  21. Unfortunately the only way to "bind" individual properties (in this case InnerDigital values but it really applies to other properties as well) requires Powershell although there is a trick that will allow you to use the PowerGadgets Creator UI later to customize the visual attributes. 1) Write a powershell script that collects the data you need from different SQL statements into an object. This will be your data layer :-) $count = (invoke-sql -Server YourServerName -Database YourDatabaseName -SQL "SELECT Count(*) as MyCount FROM Movies").MyCount $quantity = (invoke-sql -Server YourServerName -Database YourDatabaseName -SQL "SELECT SUM(Quantity) as Quantity FROM Movies").Quantity $obj = new-object System.Object add-member -inputobject $obj -membertype NoteProperty -Name Count -value $count add-member -inputobject $obj -membertype NoteProperty -Name Quantity -value $quantity $obj 2) Create a PowerGadgets template (not a PGF) with as many inner gauges as needed. Note that to move an inner gauge you will need to set its Layout.Target to AnchorPoint so that you can move it around using Layout.AnchorPoint out-gauge -config 3) Pipe the data returned by your script to a gauge that uses the previously saved template C:\Scripts\dbdata.ps1 | out-gauge -value Count -template InnerDigital -InnerGauges_0_DigitalPanel_Value {$_.Quantity} If you already use Powershell at this point you can customize your template and possibly save the previous command in a separate script. If you want to use PGF files so that you can simply double click and run, you can use the following trick - Run the gauge command and press "Ctrl-C" when the gadget window has the focus - Run the Powergadgets Creator and press "Ctrl-V" a new gadget will be added that uses powershell as the data provider and has the additional links between the inner digital and the extra properties - Remove the empty item present in your gadget (Edit - Previous) and then (Edit - Delete) You can see an explanation of this feature on this blog post Regards, JuanC
  22. If your CSV will ALWAYS have more than 1 value then Marco's reply is what you need. Use Powershell to use only the last X number of items in the CSV. Please note that as the file grows larger, Powershell will take more time to process it all and return the last 10 elements. If you CSV only has the last point, then I am afraid we do not expose the realtime settings when using the creator. JuanC
  23. - You should use either ToolTipFields ot ToolTipFormat but not both. - We have found a bug in some versions of PowerGadgets that make ToolTipFields parameter ignored, this issue has been fixed on build 2783 or later. We will make this build available shortly. - With a fixed version you should be able to just say -ToolTipFields Site and you will get the following tooltip Tickets:22Site: XYX Note that currently we do not support scriptblocks in ToolTipFields and that we will automatically start with the field being charted. Would this be enough for your scenario or is the order of the 2 lines important? If you want to see Facility instead of Sites you could modify your SQL statement to return the field as Facility. JuanC
  24. Our default behavior is as follows If the data being fed into the chart has more than 1 elements (in SQL your statement returns more than 1 rows, in powershell your statement/script returns more than 1 object) we will reload the new data and destroy the old data. If you do not get this on the sidebar please try running the same gadget on the desktop, this would tell us if you are experiencing a refresh issue on the sidebar. If the data being fed into the chart has only 1 element our default behavior is to only keep the last 20 points. If you have powershell installed you should be able to see this behavior by typing the following get-date -uformat "%S" | out-chart -refresh 0:0:1 -axisy_max 60 This command will show you the current number of seconds and after 20 seconds you should not see new bars added but instead the tail behavior you expected. You can control the number of points by using the -realtime_buffersize parameter, e.g. get-date -uformat "%S" | out-chart -refresh 0:0:1 -axisy_max 60 -realtime_buffersize 5 Regards, JuanC
  25. Please note that our charts require at least one numerical column so if your Name and Version properties are both string I am afraid we will not know how to plot 1.0 or 2.0.5 Theoretically you could write a script to translate 2.0.5 into numbers (e.g. 205) but I am not sure how good this will look. JuanC
×
×
  • Create New...