Giter Site home page Giter Site logo

Comments (6)

martynasma avatar martynasma commented on June 26, 2024 1

Well, I'm not sure about qt, but Chrome will never allow exporting the image when loaded locally. We're not aware of any workarounds, I'm afraid. Maybe it's not Chrome or qt, maybe it's the restriction of the rendering engine. I wish there was something more that we could do for you.

from amcharts3.

martynasma avatar martynasma commented on June 26, 2024

This error means that you have an image loaded from different host than the web page itself ("tainted") OR you are loading this web page directly from the file system (file:///). Try loading it through web server. If the issue still persists, make sure that amCharts libraries are loaded from the same host as the web page displaying the chart itself.

from amcharts3.

iprotsyuk avatar iprotsyuk commented on June 26, 2024

Yes, I load the web-page directly from a file system. Actually, I'd like to embed amcharts into a native c++ app for graph visualization, that's why I'm looking for a solution without a web-server. Are there any options for this?

from amcharts3.

martynasma avatar martynasma commented on June 26, 2024

That won't work I'm afraid, due to aforementioned browser security restrictions.

In this case you will need to embed your data as a JavaScript (JSON) code along the chart code.

I.e.:

var chartData = [{
  "category": "1",
  "value": 100
}, {
  "category": "2",
  "value": 110
}];

AmCharts.makeChart("chartdiv", {
  // ...
  "dataProvider": chartData,
  // ...
});

I hope this helps.

from amcharts3.

iprotsyuk avatar iprotsyuk commented on June 26, 2024

Yep, this is what I do, and everything works fine except the export plugin. I use qt webkit for html rendering, and I changed all its default security settings to allow working with local files, but it still gives me this security error.

Sorry for misleading you in the beginning. Chrome gives the same error with local files, and it uses webkit under the hood. As most of people are more familiar with chrome than qt webkit, I raised a bit different question, but I believe that the solution must be the same.

from amcharts3.

iprotsyuk avatar iprotsyuk commented on June 26, 2024

Alright, there's definitely a way to hack into html, pull an image out of canvas and pass it to the wrapping c++ code and save it afterwards. But of course, it would be easier for me to just use a working and tested solution. Thanks anyway.

from amcharts3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.