Jump to content

Use as a guage of unigui? Someone with an idea ...


gpaulino

Recommended Posts

http://try.sencha.com/extjs/4.0.7/examples/charts/gauge/viewer.html

 

How use:

 

1. Add to form UniChart1

2. UniChart1.Legend.Visible := False;

3. Add UniChart1 - > ClientEvents -> UniEvents add chart.beforeInit(sender)

function chart.beforeInit(sender){
  var store = Ext.create('Ext.data.JsonStore', {
    fields: ['value'],
    data: [
        { 'value':70 }        
    ]
  });
  
  sender.store = store;
  //sender.width = 200;  
  sender.margin = 20;
  sender.height = 200;
  sender.animate = true;
  sender.animate = {
                easing: 'bounceOut',
                //easing: 'elasticIn',
                duration: 1000
                };
  sender.insetPadding = 30;
  sender.axes = [{
        type: 'gauge',
        position: 'gauge',
        minimum: 0,
        maximum: 100,
        steps: 10,
        margin: 10
    }];
  sender.series = [{
        type: 'gauge',
        field: 'value',
        donut: 30,
        colorSet: ['#F49D10', '#ddd']
    }];
}

post-906-0-26862000-1389443249_thumb.png

 

Result:

post-906-0-96143000-1389443424_thumb.png

 

setValue:

UniSession.AddJS('Ext.getCmp('+UniChart1.JSName+'.items.getAt(0).id).store.getAt(0).set(''value'', Math.round(Math.random()*100));');
UniSession.AddJS('Ext.getCmp('+UniChart1.JSName+'.items.getAt(0).id).store.getAt(0).set(''value'', 90);');
  • Upvote 1
Link to comment
Share on other sites

 

http://try.sencha.com/extjs/4.0.7/examples/charts/gauge/viewer.html

 

How use:

 

1. Add to form UniChart1

2. UniChart1.Legend.Visible := False;

3. Add UniChart1 - > ClientEvents -> UniEvents add chart.beforeInit(sender)

 

 

Hi DDeveloper!

 

 

Very nice your anwser, it will be very helpful for me!

 

But I could not find this:

 

3. Add UniChart1 - > ClientEvents -> UniEvents add chart.beforeInit(sender)

 

I have placed the UniChart on my form and there is no ClientEvent option on the property panel.

 

It also gives an compilation error:

 

unit UniChart;
{$I RTTI.inc}
 
 
interface
 
uses
  Classes, SysUtils, Chart, TeEngine, TeeProcs, UniPanel, uniGUIRTTI, uniGUIConst,
  UniGUIClasses, ExtPascal, Ext, ExtChart, ExtData, UniGUIApplication, Series, UniExtUtils,
  Controls, UniGUITypes, UniGUIFont, Windows;

 

 

That "Chart" unit is not found.  However if I open the Chart DEMO it compiles and works. I am using Delphi XE2

 

Thank you !

 

Eduardo

Link to comment
Share on other sites

I have found the compiling problem, I have added "VCLTee. " in front of the chart and other units that are related to TeeChart and it compiled.

 

However ht char shows up as a blank page only;

 

and I could not find the ClientEvents on the property panel like you presented.

 

Eduardo

Link to comment
Share on other sites

I have found the compiling problem, I have added "VCLTee. " in front of the chart and other units that are related to TeeChart and it compiled.

 

However ht char shows up as a blank page only;

 

and I could not find the ClientEvents on the property panel like you presented.

 

Eduardo

 

post-906-0-29018900-1389464647_thumb.png

Link to comment
Share on other sites

 

Delphi Developer,

 

Where should I open this dialog?

 

I have placed on my form the TUniChart component and it does not show any ClientEvents property.

 

I have found it on the TUniForm, but there is nothing like you mentioned.

 

I am using Delphi XE2 with unigui .93

 

Thank you!!!

 

Eduardo

Link to comment
Share on other sites

  • 5 years later...
  • 4 years later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...