How to render in HTML5 a chart made with FSharp.Charting? - html

There doesn't seem to be any documentation around this capability from the FSharp.Charting library, which is briefly mentioned in the main webpage in this paragraph:
F# Charting is designed so that the same charting specifications can
be supported when using different charting implementations. For
example, the Try F# charts use similar charting specifications,
implemented using in HTML5 using Dojo Charts.
Any sample around that I can follow?

The documentation is not very clear - what it is trying to say is that F# Charting does not support HTML5, but you can use other libraries that do.
The most advanced one is probably XPlot, which provides wrappers over Google Charts and Plot.ly and in both of the cases, you can get the HTML representation of the chart (and do whatever you want with it).
For example, I used it to display chart in a Suave-based web site:
open XPlot.GoogleCharts
// Create a chart - the API is similar to F# Charting
let chart = Chart.Pie [ for r in results -> r.Option, r.Votes ]
// Get the HTML of the chart (you also need to load Google Charts in JavaScript)
let html = chart.InlineHtml

Related

Google charts piechart Material design

I need to show data in several types of charts and I like the look and feel of the Material design charts over the default google charts.
Linecharts and barcharts work nicely, however, a piechart does not seem to be available in Material design... Or at least.. I can't get it to work.
On this page, Google states that for every corechart, a Material design is available:
https://developers.google.com/chart/interactive/docs/gallery/barchart
Creating Material bar charts In 2014, Google announced guidelines
intended to support a common look and feel across its properties and
apps (such as Android apps) that run on Google platforms. We call this
effort Material Design. We'll be providing "Material" versions of all
our core charts; you're welcome to use them if you like how they look.
Creating a Material Bar Chart is similar to creating what we'll now
call a "Classic" Bar Chart. You load the Google Visualization API
(although with the 'bar' package instead of the 'corechart' package),
define your datatable, and then create an object (but of class
google.charts.Bar instead of google.visualization.BarChart).
On the piechart page, Material design is not mentioned at all:
https://developers.google.com/chart/interactive/docs/gallery/piechart
I have tried to draw the table as explained above, loading 'pie' instead of 'corechart' and loading 'google.charts.Pie' instead of 'google.visualization.PieChart'. This does not work.
Has anyone got a google piechart to work in Material design? Or is it really not available?
Add options theme in function drawChart()
var options = {
theme: 'material'
};

Embed html in AutoCAD

Does anyone know of a way to embed html into Autocad? I want to be able to click on an object and a window within Autocad pop-up with some pictures and text in a table. I'm hoping there's a way that looks similar to a Google earth kml when the description shows?
Yes that is possible. Autocad can be driven by Javascript meanwhile. And by that you can create own palettes which are in fact a chrome browser window which seamless integrates in the Acad application. You can nearly reach the full acad API from Javascript. And its also possible to extend the JS API by own routines as well. So you will be able to use the native links inside the drawing as well as any own Xdata or Dictionarys as well.
Getting started with Autocad Javascript|Enhance ACAD JS API by .NET| Updated JS API Reference

Forge offline Viewer creating new symbols

In the forge offline viewer, is it possible to draw some lines for creating new symbols in the drawing and get the coordinates of the symbol? Is it possible to create hatch patterns in the drawing in offline mode? Is it possible to get handles of all objects in a particular layer?
Unfortunately, Forge Viewer is for viewing only purpose, there is no formal creation API available currently, and the loaded model is read only. Through the viewer is built on the top of three.js r71. but it's a private owned maintained one, it doesn't support all features of the three.js.
However, there are a way to add custom shapes onto the Viewer viewport via the markup extension. Markup ext is archive via the drawing svg graphic to the markup canvas. It will make your life easier to add custom graphics. This code snippet is showing how to enter markup editing mode.
var markup;
viewer.loadExtension('Autodesk.Viewing.MarkupsCore').then(function(markupsExt){
markup = markupsExt;
});
markup.enterEditMode();
var cloud = new Autodesk.Viewing.Extensions.Markups.Core.EditModeCloud(markup)
markup.changeEditMode(cloud);
References:
https://forge.autodesk.com/blog/using-autodeskviewingmarkupscore-extension
https://developer.autodesk.com/en/docs/viewer/v5/reference/javascript/markupscore

World Map Framework for jQuery or HTML5

I have a project which requires an animated world map on its home page similar to this example. Flash is not an option which leaves me with html5 css jquery or other ajax framework.
Do you know any World Map Framework for jQuery, HTML 5 or other ajax frameworks?
The data does not need to be dynamic all I want is for the lines representing the from and to destinations, to be animated.
In my personal order of preference: OpenLayers, Leaflet or Polymaps
http://openlayers.org/
http://leaflet.cloudmade.com/
http://polymaps.org/
All open source, all Javascript, all IE compatible (at least for IE>8, I think)
You can try the following mapping software product which is based on HTML5 / Google Map instead of Flash:
iMapBuilder HTML5 Map Software
Map templates based (alike amMap), but use HTML5 maps instead of Flash Maps. Let you create interactive maps easily with pushpins, lines, mouse-over effects, etc.
Flight Routing Map Base a Custom Google Map
This is a flight routing map which is based on Google map, created using gmap editor.
AmMap switched from flash to JavaScript quite a long time ago, and the demo above is now made with JavaScript.

Primefaces bar Charts export to JPEG or PNG

I am trying to find out Export feature for Bar charts to JPEG/PNG... I didn't find this any where in Prime-faces demo section.
Please let me know if this feature is available in prime faces charts or not.
Also, Please let me know if we have any animation features like fade in/fade out etc...
Please share the examples or URLs on this, if any.
Any thing on this will be much appreciable!!
Primefaces chart components is based on jqPlot charting library , and although this library does not have the export feature , it is possible to achieve it with the help of jquery... (I haven't tried it myself) You can google a bit for export jqplot to png in google and you will see several articles / forum threads about the export of jqplot
here are several
Output plots to PDF/etc.
Export jqplot to PNG <-- got several links inside
export-jqplot-to-png
So basically you need to add commandButton that will call some js code that will generate the image...
I think that it is possible, but don't know how easy it is...
Regarding the animation , again , the jqplot does have some animation look here
I don't know if primefaces got it...
But its not so hard at all to use the original jqPlot charting library with primefaces...
UPDATE
Just noticed that the jqPlot does have the export to image option... look here
so you can ask the primefaces team to upgrade their jqPlot version... or use directly the jqPlot library in your project
The Primefaces chart components don't come with a built-in export feature. There is a JFreeChart integration example that produces charts in png format that can be download with a right-click.
From theory fade-in/fade-out features could be implemented with javascript/jquery.