shamasis

Members
  • Content count

    231
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by shamasis


  1. Speaking from an architectural perspective, the correct way to achieve what you need should not involve hacks of FusionChartsExportComponent.js

     

     

     

    Furthermore, if you start with updating the stream generated from the chart, you will have anti-aliasing issues and mismatched matte effects - exactly like the "ugly result" you are getting. :)

     

     

     

    You should rather try implementing this algorithm:

     

    1: Just before calling export function on the chart -

     

    1.1: getXML() from the chart and store it somewhere.

     

    1.2: Create a new XML from above (1.1) and modify the <chart> element to have animation='0' property

     

    1.3: Re-render the chart by setting new bgColor and new XML from above (1.2)

     

    1.4: When FC_Rendered is called after 1.3, export the chart.

     

    2: Once export completes and you get a completion call-back event -

     

    2.1: Re-Render the chart by setting original bgColor and modified XML with animation=0 (1.2)


  2. Greetings,

     

     

     

    You are going on the right track... but certain aspects needs modification.

     

     

     

    You cannot export swf to img at server-side. You will have to do it client-side.

     

     

     

    What the above implies is that you will have to either:

     

    Method 1. Create JS function that opens a new page with FusionCharts only and prints it.

     

    Mehtod 2. Update the page to dynamically hide all other elements and show FusionCharts only and then print.

     

    Method 3. Edit FusionCharts Free source code to generate image in some format and then show it.


  3. Greetings,

     

     

     

    FusionCharts Free does not have a JavaScript API that allows you to export to PDF or print a chart in ways similar to FusionCharts v3.

     

     

     

    However, if you otherwise print a standard HTML page with FusionCharts Free embedded in it, you are most likely to get a proper print. For a browser, the print function can be easily executed for a page using window.print()

     

     

     

    And just as a side-note... FusionCharts Free is open source, hence the code is freely available to be modified to suit your needs. :)


  4. Oh this is a common issue with many online forums! What you do is simply "htmlencode" your text while writing. HTML-Encoding is the process of replacing certain special characters with their respective codes. An exhaustive list for the same can be found at http://www.w3schools.com/tags/ref_entities.asp.

     

     

     

    As a ready-to-go pointer, replace some characters in your post as below:

     

    If your code contains & replace it with &

     

    Similarly:

     

    < with <

     

    > with >

     

     

     

    Specifically for our forum, you need not do this if you are using Internet Explorer... and of course Mac does not have (for good or for bad) Internet Explorer!!! :)


  5. Greetings,

     

     

     

     

     

    If you are using FusionCharts Free (as you have posted in the FusionCharts Free forum), let me tell you that your XML should start with <graph and not <chart....

     

     

     

    Thus your XML should be:

     

    <graph caption='Aged Receivables - 7 Buckets' xaxisname="Receipt Number" yaxisname="Amount Due Remaining" palette="4" decimals="0" enableSmartLabels="1" enableRotation="0" bgColor="99CCFF,FFFFFF" bgAlpha="40,100" bgRatio="0,100" showBorder="1" showAboutMenuItem="0" labelDisplay="Rotate" slantLabels="1">

     

    <categories>

     

    <category toolText="(Blanks)" label="(Blanks)"/>

     

    </categories>

     

    <dataset seriesName="19-Dec-2003" showValues="0">

     

    <set value="163" link="drillDownJS2('19-Dec-2003','(Blanks)','368',' ',' ','parnames','parvals','viewName');"/>

     

    </dataset>

     

    <dataset seriesName="03-Jan-2004" showValues="0">

     

    <set value="66" link="drillDownJS2('03-Jan-2004','(Blanks)','368',' ',' ','parnames','parvals','viewName');"/>

     

    </dataset>

     

    <dataset seriesName="12-Jan-2004" showValues="0">

     

    <set value="42" link="drillDownJS2('12-Jan-2004','(Blanks)','368',' ',' ','parnames','parvals','viewName');"/>

     

    </dataset>

     

    <dataset seriesName="20-Dec-2003" showValues="0">

     

    <set value="36" link="drillDownJS2('20-Dec-2003','(Blanks)','368',' ',' ','parnames','parvals','viewName');"/>

     

    </dataset>

     

     

     

    </graph>

     

     

     

    Also, this seems to be a FusionCharts v3 XML and some of the features might not be supported by FusionCharts Free.


  6. Now as you see, here stands one issue. FusionCharts, as of now, does not have a native event fired on update. The jQuery plugin will manually trigger the update when updateFusionCharts() function is used, hence we will try to standardise something. Perhaps, we will raise the event even when data is not changed and keep a "datachanged" flag as parameter to the event handler. But this may prove to be tough to implement.

     

     

     

    The $(':fusioncharts') method will not require much of an implementation from our plugin perspective as ":fusioncharts" selector is already present and events will propagate through to the top.

     

     

     

    But, we have tested that this method is not performance oriented and has a bad profile when used with significant number of charts. On the other hand, Manually triggering $(window).trigger() performs better. Nevertheless, if the loss is not that huge, we will opt for the one that is more usable!

     

     

     

     

     

    PS: Yes... there is an undocumented updateFusionCharts function in our jQuery plugin which you can experiment with. It does NOT work with jQury 1.4.x (due to limitation in jQuery), but works with 1.3.2 and hence we do not recommend to use it as of now. The code updateFusionCharts({ type: 'Pie3D' }); will change only the chart type of an existing chart... similarly updateFusionCharts({ data: 'mynewdata.xml' }); will just update the chart with new data and without re-rendering!


  7. Greetings Matthew,

     

     

     

    Nice to hear from you again. :)

     

     

     

    We are planning to fully integrate FusionCharts native events with jQuery events and in the process, this idea seems promising.

     

     

     

    What if a code like this works:

     

    jQuery('#myDiv:fusioncharts').bind('update', function($1) {
    
       jQuery('#myOtherDiv:fusioncharts').updateFusionCharts({
    
           data: 'myNewData.xml'
    
       });
    
    });

     

     

     

    Instead of the native events that FusionCharts generate FC_Rendered, etc... we want users to bind like:

     

    jQuery('#myDiv:fusioncharts').bind('render', function() {
    
       // do stuffs here
    
    });

     

     

     

    And perhaps, will also have a way to raise global events... for earlier users of FC_Rendered. What is your take on global events? Should we do:

     

    $(window).bind('fusioncharts.render', function() {
    
       // do stuffs here
    
    });

     

    or maybe do an aggregate alternative to work on events for ALL charts like:

     

    $(':fusioncharts').bind('render', function() {
    
       // do stuffs here
    
    });


  8. Greetings,

     

     

     

    You can use the new FusionCharts jQuery Plugin for FusionCharts to make this code generation a bit easier. The documentation for the same is available at: http://www.fusioncharts.com/jquery/docs/.

     

     

     

    Furthermore, you can add your own data-handler to handle your SharePoint list XML. Once you know about the data-formats "XMLData", "URIData", "HTMLData", etc, you will realize that you can create your own handler for a new data-format (say, "SharePointList").

     

     

     

    The API to do the above is not yet documented, but you can take hints from the HTMLTable data-handler added at the bottom of the jquery.fusioncharts.debug.js file. In any case, a sample code that adds a dsta-handler that returns a blank XML and alerts the data is as follows:

     

    $.FusionCharts.datahandlers.extend({
    
       'BlankXMLData': function(options) {
    
           alert(options.data);
    
           return "<graph><graph>"
    
       }
    
    });


  9. Gary,

     

     

     

    I can see that you did get it to work. Incidentally, the issue you are facing is the exact same issue we are working on!! :P

     

     

     

    There is already a function that you can experiment with, and that is .updateFusionCharts(). This supposedly works fine with jQuery 1.3.2 but fails for a bug in jQuery 1.4.x.

     

     

     

    The updateFusionCharts does the work of remembering the settings of an existing chart.

     

    Lets say, you already have a chart in a division with id "myChartDiv", and you just want to update the data of the chart. What you do is:

     

    $('#myChartDiv').updateFusionCharts({
    
       data: '<chart><!-- your new xml data here --></chart>'
    
    });

     

     

     

    You may send any settings, and it will simply keep the old ones and overwrite with whatever new you have sent. Furthermore, the function intelligently decides whether to re-render the chart or not! In case you update data only, it will simply change the data!

     

     

     

    Technically, due to a bug where jQuery 1.4.x is unable to associate data with object/embed elements, we are unable to save the state of the chart.


  10. Ah yes... you got it right! FusionCharts Free is a separate product. FusionCharts Free aims to fulfill your basic charting needs with a very commonly used set of charts, having the necessary but basic features. Its features however are a lot limited than FusionCharts v3.

     

     

     

    FusionCharts v3, on the other hand, provides you advanced charting options like exporting chart as image/PDF, gradients, 3D lighting, better animation with an easy way for building your own animation styles, exporting chart data as CSV/XML, in-built debugger, enhanced AJAX support and advanced filter effects like shadow, blur and bevel which you can apply to the various chart elements. It also provides advanced chart types like true 3D charts, scroll charts, glass-effect column charts, dual Y-axis charts to name a few.

     

     

     

    FusionCharts v3 evaluation version allows you to try out all these advanced options and more. So, if you are aiming to use FusionCharts v3, you can already start using the no-limitation FusionCharts v3 Evaluation from http://www.fusioncharts.com/download/.

     

     

     

    You can easily use the existing jQuery Plugin by simply implementing the code sample to change default configuration mentioned at http://www.fusioncharts.com/forum/Topic26755-77-1.aspx.

     

     

     

    And then you can take hints from this blog post: http://www.shamasis.net/2010/03/jquery-plugin-for-fusioncharts-1-0-0b/

     

    Read the section there saying "Using this plugin with FusionCharts v3".


  11. In case you need to repeatedly provide the same parameters to charts created using this plugin, you may choose to update the default configuration itself! This will save you from repeatedly writing the same code and would also help in consolidating settings ate one place.

     

     

     

    Using the "extend" method of jQuery, one can easily update the default settings of FusionCharts jQuery plugin.

     

     

     

    For instance, if you want to update the "swfPath" attribute's default value to point to a different location, you can write the following code.

     

    <script type=

  12. Greetings,

     

     

     

    Refer to "3. Plugin Usage -> Providing Data to Charts -> Passing XML String As Data" section of the jQuery documentation PDF located at http://www.fusioncharts.com/jquery/docs/.

     

     

     

    Also, in the downloadable package, refer to "Examples/data-source-xmldata.html" file that has a sample implementation of single-series charts. You can easily change it to multi-series by (1) using a multi-series chart alias in "type" attribute and then (2) providing a multi-series data xml in the "data" attribute.

     

     

     

    Just in case you want to refer to FusionCharts Free documentation while building multi-series XML, see "Chart XML Reference -> Multi-Series Charts" at http://www.fusioncharts.com/free/docs/.


  13. Greetings,

     

     

     

    Ah... the latter idea is surely a good one as because in case of former, (1) own attributes will fail w3c, (2) own class would not be sufficient enough and (3) changing the HTML table to render FusionCharts should not be the goal. :)

     

     

     

    The JSON idea is cool, but there is a roadblocks that I see:

     

     

     

    FusionCharts has native XML as data-source and the fact that you know that you need an attribute in <dataset> means you know the FusionCharts XML format, thus for people wanting to beautify the charts, needs to know details of FusionCharts XML. This is surely not a problem, but anything easier is more welcome.

     

     

     

    We are contemplating upon the above issue and have certain ideas in mind. As the mature, we will surely update you. But, be assured - something will be coming your way. :(


  14. Greetings,

     

     

     

    The HTMLTable data-handler does basic HTML <table> to FusionCharts XML conversion. Currently, it allows you to specify chartAttributes only as the dataOptions { chartAttributes: "" } parameter.

     

     

     

    The plugin is still in beta stage and we are waiting for users like you to give us inputs as to what more you want to do with the HTMLTable data-handler. Right now, it seems that you want dataset attributes to be implemented. :( We are looking into a suitable API to do the same. If you have any idea, feel free to share.


  15. Hi Stephane,

     

     

     

    Great suggestion. There are already two ways to make FusionCharts attain the width and height of the parent container.

     

     

     

    1. Using percentage width and height.

     

    If you set width: '100%' and height: '100%', it sets the HTML width and height of the chart to 100%. This makes the chart occupy the area of the parent container.

     

     

     

    2. Using "auto" for width and height of the chart

     

    This not yet documented (as per plugin version 1.0.0b) as it is an experimental feature.

     

    Here, if you set width: 'auto' and height: 'auto', it sets the dimension of the chart to parent.width() and parent.height() respectively in pixels.

     

     

     

    The above two methods have one limitation as we foresee. In case the container has no set dimension or in case the container is not fully rendered, the chart does not receive the proper dimension. And as because FusionCharts v3 does not support native resizing as of now, it might render odd.

     

     

     

    As a workaround to the above issue, if we render the chart after the page is loaded using $(document).ready() event, this issue is partially fixed.

     

     

     

    Another point to note: Would it be prudent if we set it to occupy 100% by default? Now we have kept it to 320x480 for the reason that in majority of cases, the container element may not have a width or height set. In such situations, the charts will have 0 width or height and will not render. This may lead to confusion for a majority of users who would not understand why the chart is not rendering.


  16. Greetings,

     

     

     

    The updated dom framework (posted in this topic) supposedly solves most IE related issues! David Lai's fix has been already incorporated in this updated framework, so you do not need to separately implement that. :D

     

     

     

    What you can do is either send us a scaled-down version of your codes or send us a live link. Giving us both would be a plus.