![]() ![]() The user should confirm that he gives the app the rights to post the image. If the user isn't authorized, the Twitter Authorization dialog will be displayed. There are two options here: the user is authorized in the An圜hart Twitter application or not. sharing/twitterįirst of all, the user sends a request to /sharing/twitter that contains SVG or script from which the image will be generated and posted on the page - the request should contain the same parameters as a request to /png URL does. It requires MySQL database to be set up and uses three types of requests. Sharing images on Twitter is implemented with the An圜hart Twitter app. These social networks get the prepared picture via the link and just allow the user to post it on the page. Sharing on Facebook, LinkedIn, and Pinterest is implemented with the help of the commands for saving images. Sharing on Facebook, LinkedIn, and Pinterest You should provide the access to shared image through that URL by setting up Nginx, for example. The second parameter is the URL prefix which will be concatenated with a shared image name and returned to a user. The first parameter is the path to the folder where images will be stored. When you use the Export Server on your own server and you want the sharing to work properly, you should set up -saving-folder and -saving-prefix. The An圜hart Export Server provides an ability to share chart images in social networks, such as Facebook, Java -jar export-server.jar -C settings.toml You can pass a config file with -C option, like this: Script = "var chart = anychart.line() ntainer('container') chart.draw() " # here you can pass cmd options for mode = "cmd" # settings from twitter app settings for sharing in Twitter # prefix which will be returned when saving image Make the background white or leave it transparentĪn圜hart Export Server provides an ability to pass all parameters in a config file using TOML format: If it presents, request returns URL of a saved image ![]() Script or SVG that should be transformed into a pictureĪ field that contains the information about the data, it might be "script" or "svg"Ī field that tells how to export the result (file or as base64) Typical Export and Twitter Sharing request contains the parameters listed below: Parameter RequestsĪn圜hart Export Server supports the following requests: URL Now you are ready to launch the An圜hart Export Server. Let's add a custom border around menu items as an example. However, if you'd like to modify certain style aspect of the menu, you easily override it using your own custom CSS. StylingĪ default styling to export menu is automatically applied by creating relative stylesheets on the web page. Check " Export menu in external container" for more details and an example. NOTE You can also place your menu anywhere on the page. Go ahead, hover on the export button to see how menu items have re-arranged themselves to accommodate for the new position. See the Pen amCharts V4: Export (2) by amCharts ( on CodePen.24419 Let's see how it goes if we place it in the top-left corner using this code: = new am4core.ExportMenu() Ĭ = "top" = new am4core.ExportMenu() Ĭ = "top" These settings will also affect how the menu looks like and opens up. VerticalAlign controls vertical positioning of the legend with the following options for its value: "top" (default), "middle", and "bottom" It's easy to re-position it using two of the menu's settings: align and verticalAlign.Īlign controls horizontal positioning and accepts following values: "left", "middle", and "right" (default). Positioningīy default, menu is placed in the upper-right corner of your chart. If you want, you can leave it at it - it's fully functional. You can see a somewhat dimmed out button in the upper right corner, that when hovered will display export options for various image and data formats, as well as print. See the Pen amCharts V4: Export (1) by amCharts ( on CodePen.24419 Let's take a very basic chart and see how it looks like: To enable it, you will need to assign an instance of ExportMenu to chart's nu property: = new am4core.ExportMenu() Ĭ = new am4core.ExportMenu() Export menu EnablingĮven though export functionality is built-in, the end-user controls - menu - are not enabled by default. This article is dedicated on how to enable this functionality for chart users, as well as do deeper integrations using API. It allows saving chart view or its data into various formats, like JPEG, PNG, PDF, XLSX, CSV, or JSON. AmCharts 4 has exporting functionality built right into its core.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |