Jump to content
JChartFX Community


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Sat

  • Rank
  1. Sat


    Hi, I have used Line chart To display data from db. Now the Db will return 4 items. but i need to show 2 items in Line Chart and In Tooltip i want the 4 items to show. How to do this? Below my sample code. var divHolder = document.getElementById('ChartDiv'); $(divHolder).html(''); chart1 = new cfx.Chart(); var axisY = chart1.getAxisY(); var title = new cfx.TitleDockable(); title.setText("Report"); chart1.getTitles().add(title); chart1.setGallery(cfx.Gallery.Lines); var legBox = chart1.getLegendBox(); legBox.setDock(cfx.DockArea.Bottom); legBox.setContentLayout(cfx.ContentLayout.Center); //----Assign data fields-------- var fields = chart1.getDataSourceSettings().getFields(); var field1 = new cfx.FieldMap(); var field2 = new cfx.FieldMap(); var field3 = new cfx.FieldMap(); var field4 = new cfx.FieldMap(); field1.setName("amt_date"); field1.setDisplayName("Date"); field1.setUsage(cfx.FieldUsage.XValue); // fields.add(field1); // chart1.getAxisX().getLabelsFormat().setCustomFormat("MM/dd/yyyy"); // chart1.getAxisX().getDataFormat().setFormat(cfx.AxisFormat.DateTime); field2.setName("credit"); field2.setDisplayName("Credit"); field2.setUsage(cfx.FieldUsage.Value); fields.add(field2); field4.setName("debit"); field4.setDisplayName("Debit"); field4.setUsage(cfx.FieldUsage.Value); fields.add(field4); //----Set Sample Data------------ chart1.setDataSource(Data); var chartDiv = document.getElementById('ChartDiv'); chart1.create(chartDiv);
  • Create New...