Hi, 

I want to save some WCartesianChart as images but what I get as png file is a 
chart but a black plot zone…(WCartesianChart rendering is fine)
I have wt-3.2.3, last haru-master from git and  graphicsmagick-dev  
1.4-0.020121013
I get some strange things when rendering in WRasterImage in output :
=====
attribute not recognized: i
attribute not recognized: n
attribute not recognized: f
attribute not recognized: e
attribute not recognized: e
attribute not recognized: e
attribute not recognized: e
=====

My source code is the following :

================= 

  int nbpts = xcor.size();
  WStandardItemModel *model = new WStandardItemModel(nbpts, 2, parentContainer);
  for (int i = 0; i < nbpts; ++i) {
    model->setData(i, 0, xcor.at(i));
    model->setData(i, 1, ycor.at(i));
  }
  WCartesianChart *chart = new WCartesianChart(parentContainer);
  chart->initLayout();

  chart->setModel(model);        // set the model
  chart->setXSeriesColumn(0);    // set the column that holds the X data
  chart->setLegendEnabled(true); // enable the legend

  chart->setType(ScatterPlot);   // set type to ScatterPlot

  chart->axis(XAxis).setLocation(ZeroValue);
  chart->axis(YAxis).setLocation(ZeroValue);

  // Add the curves
  WDataSeries s(1, CurveSeries, Y1Axis);
  chart->addSeries(s);

  chart->resize(300, 300); // WPaintedWidget must be given explicit size

 Wt::WRasterImage pngImage("png", 600, 600);
 Wt::WPainter p(&pngImage);

 chart->paint(p);
 std::string name;
 name = WORKINGAREA+"/chart-"+sessionId ()+".png";
 std::ofstream f(name.c_str(), std::ios::out |std::ios::trunc | 
std::ios::binary);
 pngImage.write(f);
================= 

Any ideas ?

Cheers, 
Laurent


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to