ChartFX trouble

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ChartFX trouble

Michael Coninx
Hello,

I'm trying to build a simple chart with the new ChartFX plugin.
On the Y-axis I want to show a number, on the X-axis a corresponding year.

Using the following code, the chart is generated, but the year is
interpreted as data for the Y-axis.

    var: 'data' = (array);

    $data->(insert: (array: 'Data', 'Year'));
    $data->(insert: (array: 100, 2000));

    var: 'c' = (chartfx);
    $c->setWidth(540);
    $c->setHeight(360);
    $c->setTemplateStr((include: 'examples/template.cfx.lasso'));
    $c->setLassoData($data);
    $c->SetDataType(0,'VALUE');
    $c->SetDataType(1,'XVALUE');

    var: 'temp' = $c->render;

    (string: $temp)->(replace: '>', ' width="540" height="360" />') &;

Anybody know how to use the SetDataType member tag, or is this maybe a bug?
In the Lasso Reference, I read "See the Lasso 8 Language Guide for
examples of how to use this tag."
But I haven't found anything in there for the new ChartFX plugin. Am I
missing something?

When changing
    $data->(insert: (array: 100, 2000));
to
    $data->(insert: (array: 100, ' 2000'));
it works, but I would like to know how to use the SetDataType member tag
instead of using this workaround.

Using LP 8.5.1.b4 on Mac OS 10.4.7. (Intel mini)

Thanks,

Michael

------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ChartFX trouble

Fletcher Sandbeck
On 2006-07-31 at 15:55 by [hidden email] (Michael Coninx):

>I'm trying to build a simple chart with the new ChartFX plugin.
>On the Y-axis I want to show a number, on the X-axis a corresponding year.

Take a look at the "Read Me.pdf" file in the Chart FX folder.  It contains documentation for Chart FX.

>Using the following code, the chart is generated, but the year is
>interpreted as data for the Y-axis.
>
>   var: 'data' = (array);
>
>   $data->(insert: (array: 'Data', 'Year'));
>   $data->(insert: (array: 100, 2000));
>
>   var: 'c' = (chartfx);
>   $c->setWidth(540);
>   $c->setHeight(360);
>   $c->setTemplateStr((include: 'examples/template.cfx.lasso'));
>   $c->setLassoData($data);
>   $c->SetDataType(0,'VALUE');
>   $c->SetDataType(1,'XVALUE');
>
>   var: 'temp' = $c->render;
>
>   (string: $temp)->(replace: '>', ' width="540" height="360" />') &;
>
>Anybody know how to use the SetDataType member tag, or is this maybe a bug?

In the [ChartFX->SetDataType] tag, XVALUE indicates that that values hould be read as the x-value for an xy scatter plot.  LABEL indicates that the value should be used as the label of the x-axis.

You can control the formatting of the x-axis labels within the template.  By setting LABELSFORMAT you can tell Chart FX that the value is a date and it will be treated somewhat differently than if it were a string.  Although for years this might not be important.

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Director of Product Development       http://www.lassostudio.com
OmniPilot Software, Inc.                http://www.omnipilot.com

------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ChartFX trouble

Michael Coninx
Fletcher,

Thanks for the help, how did I miss the "Read Me.pdf" document :-)

To use the SetDataType member tag, it has to be put before the
setLassoData member
tag which loads the data for the chart! My X-axis labels are displayed
as eg "2000.0"
but I guess I have to change the template as you suggested below to
display it as "2000".

Michael

Fletcher Sandbeck wrote:

>On 2006-07-31 at 15:55 by [hidden email] (Michael Coninx):
>
>  
>
>>I'm trying to build a simple chart with the new ChartFX plugin.
>>On the Y-axis I want to show a number, on the X-axis a corresponding year.
>>    
>>
>
>Take a look at the "Read Me.pdf" file in the Chart FX folder.  It contains documentation for Chart FX.
>
>  
>
>>Using the following code, the chart is generated, but the year is
>>interpreted as data for the Y-axis.
>>
>>  var: 'data' = (array);
>>
>>  $data->(insert: (array: 'Data', 'Year'));
>>  $data->(insert: (array: 100, 2000));
>>
>>  var: 'c' = (chartfx);
>>  $c->setWidth(540);
>>  $c->setHeight(360);
>>  $c->setTemplateStr((include: 'examples/template.cfx.lasso'));
>>  $c->setLassoData($data);
>>  $c->SetDataType(0,'VALUE');
>>  $c->SetDataType(1,'XVALUE');
>>
>>  var: 'temp' = $c->render;
>>
>>  (string: $temp)->(replace: '>', ' width="540" height="360" />') &;
>>
>>Anybody know how to use the SetDataType member tag, or is this maybe a bug?
>>    
>>
>
>In the [ChartFX->SetDataType] tag, XVALUE indicates that that values hould be read as the x-value for an xy scatter plot.  LABEL indicates that the value should be used as the label of the x-axis.
>
>You can control the formatting of the x-axis labels within the template.  By setting LABELSFORMAT you can tell Chart FX that the value is a date and it will be treated somewhat differently than if it were a string.  Although for years this might not be important.
>
>[fletcher]
>  
>


------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage