Jump to content
Software FX Community

juanZ

Members
  • Posts

    141
  • Joined

  • Last visited

Posts posted by juanZ

  1.  Hi Divyesh

    Create a new asp.net project, add a new page and copy replace the html code with this code.

     PAGE LOAD CODE

    Chart1.Data.Series = 1;
      Chart1.Data.Points = 6;
      Random r = new Random(1);
      int i;
      for (i = 0; i < 6; i++)
      Chart1.Data[0, i] = 100 * r.NextDouble();
      Chart1.AxisX.Labels[0] = "1st";
      Chart1.AxisX.Labels[1] = "2nd";
      Chart1.AxisX.Labels[2] = "3rd";
      Chart1.AxisX.Labels[3] = "4th";
      Chart1.AxisX.Labels[4] = "5th";
      Chart1.AxisX.Labels[5] = "6th";

     

    ASPX CODE

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
      <title>Untitled Page</title>
    </head>
    <script language="javascript" type="text/javascript">

    function ShowFirstLabel(){
        var chx = document.getElementById("Chart1");
      var lbl = document.getElementById("Label1");
     
      chx.view3d.enabled = true;
     
      alert(chx.AxisX.Labels.Item(0) + ' ' +
      chx.AxisX.Labels.Item(1) + ' ' +
      chx.AxisX.Labels.Item(2) + ' ' +
      chx.AxisX.Labels.Item(3) + ' ' +
      chx.AxisX.Labels.Item(4) + ' ' +
      chx.AxisX.Labels.Item(5));
    }
    </script>
    <body>
      <form id="form1" runat="server">
      <div>
      <chartfx7:Chart ID="Chart1" runat="server" RenderFormat=".Net" UseCallbacksForEvents="true">
      </chartfx7:Chart>
      </div>
      <div>
      <br />
      <input id="Button1" type="button" value="Show Axis Label" onclick="ShowFirstLabel();" />
      </div>
      </form>
    </body>
    </html>

  2.  I tested the following successfully on IE8:

    Default2.aspx 

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

    <%@ Register Assembly="ChartFX.WebForms" Namespace="ChartFX.WebForms" TagPrefix="chartfx7" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
      <title>Untitled Page</title>
    </head>
    <body style="background-color:Red">
      <form id="form1" runat="server">
      <div>
      <chartfx7:Chart ID="Chart1" runat="server" RenderFormat=".NET">
      </chartfx7:Chart>
      </div>
      </form>
    </body>
    </html>

     

    Default.aspx

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
      <title>Untitled Page</title>
    </head>
    <body>
      <form id="form1" runat="server">
      <div>
      <iframe src="Default2.aspx" width="100%" height="300">

      </iframe>

      </div>
      </form>
    </body>
    </html>

  3.  Hi,

    Chart FX 7 for Java Desktop installer puts the trial the license as a registry entry. If you installed Chart FX with an account that is not administrator or does not have enough pemissions, the installer will not write the registry. Then Chart will look for that entry and if not found will throw the "Couldn't get Run Time license" message. The registry entry you should look is: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs\/Classes/Root\/Licenses\9cdf80d0-1f77-4ee1-bd2a-c2a8d592345f

     So, please log with your administrator account. Domain account not always has the same permissions. unistall your product and reinstall it again.

  4.  Hi,

    The following code snippet will show you how to create and set 2 panes into a Chart FX 6.5 for Java. The pane separation will not create 2 different charts. It will split series into different panes inside the chart. Yo can assign different Y Axis to those panes.

    The complete version of this sample including data and styles is part of the Chart FX 6.5 for Java Samples. This samples are in the installation folder of Chart FX.

     

    chart1.getAxisX().getLabelsFormat().setFormat(AxisFormat.DATE); SeriesAttributes series0 = chart1.getSeries().getItem(1);series0.setGallery(Gallery.LINES); series0.setLineWidth((short) 2);series0.setMarkerShape(MarkerShape.NONE); series0.setYAxis(YAxis.MAIN);SeriesAttributes series1 = chart1.getSeries().getItem(0);series1.setGallery(Gallery.AREA); series1.setBorder(true);series1.setYAxis(YAxis.SECONDARY);Axis axis = chart1.getAxis().getItem(YAxis.MAIN);axis.setStyle(axis.getStyle()|AxisStyle.INTERLACED);axis.setForceZero(false);axis.getLabelsFormat().setFormat(AxisFormat.CURRENCY);axis = chart1.getAxis().getItem(YAxis.SECONDARY);axis.setScaleUnit(1000000);axis.getLabelsFormat().setDecimals(0);chart1.recalcScale();chart1.getAxisY().setPane(0);chart1.getAxisY2().setPane(1);chart1.getAxisY2().setPosition(AxisPosition.NEAR);Pane pane1 = chart1.getPanes().getItem(0);pane1.setProportion(15);pane1.getTitle().setText("Price");Pane pane2 = chart1.getPanes().getItem(1);pane2.setProportion(8);pane2.getTitle().setText("Volume (in Millions)");

     

    Hope this helps.

  5.  Well, real time concept in Chart FX java 7 for desktop and Web applications is different. I'll supose that the real time implementation you looking for is by using Ajax or an asyncronous method to refresh chart.

     

    this is a sample I made that makes a button hide a series of the chart. You can modify this sample at will. userCallbackEventHandler method will receive the request from the button (or in your case the drop down list).

     

    <%@page import="com.softwarefx.chartfx.server.*"%><%@page contentType="text/html" pageEncoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>   <head>   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">   <title>Javascript Sample : Chart FX 7 Server</title>   </head>   <script type="text/javascript">   function setVisible(iSeries) {   param=iSeries // this is the parameter sent from the button. (in your case the drop down list)   SFX_SendUserCallback('chart1',param ,false);   }   </script>   <body>   <%   ChartServer chart1 = new ChartServer(pageContext,request,response);   chart1.setID("chart1");   chart1.setWidth(600);   chart1.setHeight(400);   chart1.setUseCallbacksForEvents(true);   chart1.addUserCallbackListener(new UserCallBackEventHandler ());   chart1.renderControl();   %> <%!   public class UserCallBackEventHandler  implements UserCallbackListener   {   public void userCallbackEventHandler (UserCallbackEvent e)   {   ChartServer chart1 = (ChartServer)e.getSource();   String params = e.getParam();   chart1.getSeries().get(Integer.parseInt(params)).setVisible(false);   }   }   %>   <button OnClick="setVisible(0)">Serie1</button>   <button OnClick="setVisible(1)">Serie2</button>   <button OnClick="setVisible(2)">Serie3</button>   </body></html>

     

    hope this helps.

  6.  Hi,

     

    Try to set the heigth and width property to the rectangle.

     

      Annotations annot = new Annotations();
      chart1.Extensions.Add(annot);

      Rectangle rectangle = new Rectangle();
      rectangle.Width = 20;
      rectangle.Height = 20;

      rectangle.Fill = new LinearGradientBrush(Color.FromRgb(0, 255, 0),Color.FromRgb(0, 255, 0),45.00);
      rectangle.Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0));

      Annotations.SetAttachX(rectangle, 2);
      Annotations.SetAttachY(rectangle, 40);
      annot.Children.Add(rectangle);

     

    This worked for me.

  7. Hi,

    When chart is rendered as .Net, it becomes an Active X. As any other activex control, it is completely downloaded client side. So, server events are not straight visible. In this case, you should use SFX callbacks through javascript in order to send and bring data from the server.

    This is an example:

    you can capture toolbar and menu events using the UserCommand event.

    in you asp.net page copy this between the </head> .... <body> tags:

    <script lang="JavaScript" for="Chart1" event="UserCommand(obj, args)">

      if(args.CommandID == 1)
      {
      clientChart = document.getElementById('Chart1');
      if (clientChart.Chart) 
      clientChart = clientChart.Chart;
     
      clientChart.Series.Item(0).Gallery = 2;
     
      }
      </script>

    ...

    ...

    <chartfx7:Chart ID="Chart1" runat="server" UseCallbacksForEvents="True" RenderFormat=".Net">
    </chartfx7:Chart>

     

    You can also handle this in code behind like this:

     

     <script type="text/javascript">

      function doLoadCallback()
      {
    SFX_SendUserCallback('Chart1','Load',false);    
      }  
     
      function doCommandCallback()
      {
    SFX_SendUserCallback('Chart1','Command1',false);    
      }  
     
      </script>

    ...

    ...

    ...

    <chartfx7:Chart ID="Chart1" runat="server" OnUserCallback="Chart1_UserCallback" UseCallbacksForEvents="True">
      </chartfx7:Chart>

     

    On code behind.....

      public void Chart1_UserCallback(object sender, UserCallbackEventArgs e)
      {
      if (e.Param.Equals("Load"))
      {
      Chart1.Series[0].Color = System.Drawing.Color.Red;  
      }
      else {
      if (e.Param.Equals("Command1")) {
      Chart1.Series[0].Color = System.Drawing.Color.Pink;
      }
      }  
      }

    post-5270-13922409698962_thumb.jpg

  8. Greetings,

    Can you please send ud an email to support (support at softwarefx.com) with the following information:

    • Does the PSS service is started at windows services?
    • You are using your dataparts in MOSS or with WSS?
    • When Dataparts was in the installing process does it showed any error? 
    • Please send us the InstallFX.log and the webconfig.files
    We will more than glad to help you.
  9. Hi!

    This is a small example, but I think we can start from here.

    Please copy this into your page load method, (create an empty page with a chart for testing)

    Chart1.Data.Series = 2;   Chart1.Data.Points = 5;   Chart1.Data[0, 0] = 15;   Chart1.Data[0, 1] = 18;   Chart1.Data[0, 2] = 19;   Chart1.Data[0, 3] = 19;   Chart1.Data[0, 4] = 15;   Chart1.Data[1, 0] = 20;   Chart1.Data[1, 1] = 16;   Chart1.Data[1, 2] = 22;   Chart1.Data[1, 3] = 14;   Chart1.Data[1, 4] = 12;   Chart1.Series[0].Color = Color.DarkGreen;   Chart1.Series[0].Gallery = Gallery.Lines;   Chart1.Series[1].Gallery = Gallery.Bar;   Chart1.Series[0].SendToBack();

     

  10. When FieldUsage.XValue is used, data passed must be datetime or double value, that's why the "input string was not in a correct format" messages raise. So, you must manually assign Axis labels in order to use string types.

     vRow is a row from my DataTable object

     foreach (DataRow vRow in vTable.Rows) {

      Chart1.AxisX.Labels.Add(vRow["X-Axis].ToString());

     }

  11. Hi Paul,

    You can use the MaxHeight property of the DataView. Now, if your chart has 300px height and you want the 60% for plot area and the rest 40% for the data view, you can calculate the 40% of 300, which is 120. So, you can put chart1.DataView.MaxHeight = 120;  If your actual series does not need that 40%, that area will shrink to fit best. How ever if you dont want this and want to keep always the 40% of the area reserved, you should use the chart1.DataView.MinHeight property.

  12.  Hi Tomas,

     please send a mail to support[@]softwarefx[.]com in order to send you a sample. Also if you have any other question, please write it on the mail.

    ** Remove brackets from the mail. I put them in order to avoid so spam bots.

    Always glad to help.

  13.  Anne you are right. There is an issue related to the AxisY2 and is has been reported to our development team. However we can add an additional Y Axis (you can add more if you like) and handle it apart.

     Change AxisX Settings

      chart1.AxisX.TextColor = chart1.Series[0].Color; // because i want the same color of the first series
      chart1.AxisX.Line.Color = chart1.Series[0].Color; // you can change this color at will.
      chart1.AxisX.Visible = true;
      chart1.AxisX.Position = AxisPosition.Far;
      chart1.AxisX.ForceZero = false;

     Add New Axis Y and Change New AxisY Settings

      AxisY AddlAxisY = new AxisY();
          AddlAxisY.TextColor = chart1.Series[0].Color;
      AddlAxisY.Line.Color = chart1.Series[0].Color;
      AddlAxisY.Visible = true;
          AddlAxisY.Position = AxisPosition.Far;
          AddlAxisY.ForceZero = false;
          chart1.AxesY.Add(AddlAxisY);
          chart1.Series[0].AxisY = AddlAxisY; // we assign the series to the new axis.

     

    I hope this solves it.

×
×
  • Create New...