How can create a graphic without any bars with Amchart4 - amcharts4

we are using amchart with a project and we need to remove all bars and zoom/resize action
Our final idea is to have exactly the same chart as this
https://mdbootstrap.com/docs/angular/advanced/charts/
with just right-click to save chart as image
is this possible?
I tried to set those variables
chart.seriesContainer.draggable = false;
chart.seriesContainer.resizable = false;

Lets say if you have two axes x and y as below, its is possible to disable the grid for each axis like below
let dateXAxis = chart.xAxes.push(new am4charts.DateAxis());
let valueYAxis = chart.yAxes.push(new am4charts.ValueAxis());
dateXAxis.renderer.grid.template.disabled = true;
valueYAxis.renderer.grid.template.disabled = true;

Related

Turn NSGradient into NSColor in Swift

I am trying to make an MKPolyline for a SwiftUI map where it shows a persons location for a day and I want a gradient changing from blue to green from the first point in their location to the last point in blue. I have this code
renderer.strokeColor = NSGradient(colors: [NSColor.blue, NSColor.green])
I have also tried
renderer.strokeColor = NSColor(NSGradient(colors: [NSColor.blue, NSColor.green]))
and
renderer.strokeColor = NSColor(Color(Gradient(colors: [Color.blue, Color.green])))
but these all return errors about turning Gradients into colors. Thanks!
Thanks to #vadian I did this
if let routePolyline = overlay as? MKPolyline {
let renderer = MKGradientPolylineRenderer(polyline: routePolyline)
renderer.setColors([NSColor.blue, NSColor.green], locations: [])
renderer.lineWidth = 2
return renderer
}

How to add inline style for double underlined text in a cell after copying in spreadjs

I have been trying add custom inline styles for the cells where double underline is applied. My plan was to get the cell where the double underline is aplied and using its indexes find the currosponding td and then aplly custom style/tag.
Currently i am able to find the row and column indexes but if at all i find the row and colum index how can i find the currosponding td in the html string ?
Is there any way to find td using the row and column index ?
Is there any way to get this done, please let me know.
To apply a double underline border style to a cell / range by using the setBorder method with the LineStyle double and the borderBottom method
For example, to set a double underline to the cell A1:
window.onload = function (dashboard) {
// Initialize the Spread component with the following line:
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
var activeSheet = spread.getActiveSheet();
// create line border
var border = new GC.Spread.Sheets.LineBorder();
border.color = "red";
// line style = double
border.style = GC.Spread.Sheets.LineStyle.double;
var cell = activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport);
// setting the border to the bottom
cell.borderBottom(border);
};
If you have any other questions feel free to reach out to the SpreadJS Support Team here: Submit a ticket
Best, Mackenzie Albitz | GrapeCity Technical Engagement Engineer

Set the font size and color of an AmChart4 XYCursor's X and Y label

I've looked here:
https://www.amcharts.com/docs/v4/reference/xycursor/
and tried this
chart.cursor.fontSize = "14";
chart.cursor.fill = am4core.color("#ff0000");
chart.cursor.fontFamily = "verdana";
To style the (default white on black) element when the xycursor touches the X/Y axis (don't know what the correct name for this element is, hope you know which one I mean)
I would like to set the font size and family. Tried to set the color to red to see if it has to be set via the fill property, but also that doesn't work.
Created the cursor like this:
chart.cursor = new am4charts.XYCursor();
chart.cursor.xAxis = axis;
You have to set the tooltip properties inside the axis objects directly, as mentioned in the documentation. For example, to change the font, size and color in the category axis tooltip, modify the tooltip's label object:
categoryAxis.tooltip.getFillFromObject = false;
categoryAxis.tooltip.label.fill = "#ff0000"
categoryAxis.tooltip.label.fontFamily = "Courier New"
categoryAxis.tooltip.label.fontSize = 15;
Demo

Change bar color depending on value

I'm using chart-js/ng2-charts for an angular 2 app.
I can display a bar graph, but at the moment, all the bars are the same color. I'd like to have a different color depending on the value.
Can that be done?
After you create your chart, you can use the following function to loop through the dataset and change the color depending on the data value.
In this example, if the value is above a 50, the color changes to red.
var colorChangeValue = 50; //set this to whatever is the deciding color change value
var dataset = myChart.data.datasets[0];
for (var i = 0; i < dataset.data.length; i++) {
if (dataset.data[i] > colorChangeValue) {
dataset.backgroundColor[i] = chartColors.red;
}
}
myChart.update();
JSFiddle Demo: https://jsfiddle.net/6d0jsyxu/1/

amchart regular numeric scale on category axis in x-axis

I'm new to programming and now I want to give custom label on categoryAxies in line chart.
But that label should be regular(like 0,50,100,150).
This is my format of data.
59.0472,0.0318
69.071,0.0271
72.0913,0.0271
81.0674,0.0334
81.0734,0.0382
83.0596,0.0717
83.0894,0.0605
85.0817,0.035
85.1053,0.0287
86.0675,0.0318
87.1001,0.0287
90.6657,0.0382
I want x-axis as 0, 50 , 60, etc.
Also i have mentioned the category axis code in below
var categoryAxis = chart.categoryAxis;
categoryAxis.parseDates = false;
categoryAxis.autoGridCount =false;
categoryAxis.dashLength = 1;
categoryAxis.gridCount = 6;
categoryAxis.gridAlpha = 0.15;
categoryAxis.minorGridEnabled = true;
categoryAxis.axisColor = "#DADADA";
If you X axis should be numeric, than I would recommend you using XY chart instead of Serial, for example: http://www.amcharts.com/javascript-charts/scatter/