Line created using tcDrawLine is not displaying properly - activex

We want to create a vertical line with dashed style. We used the code below to draw the line. The line is not being displayed on the Chart until we don't manually refresh the dialog box. We included the below logic inside OnAfterDrawTchart event. Please provide your input. Source code:
long lDrawLineTool = m_reschedChart.GetTools().Add(tcDrawLine);
CDrawLineTool cDrawLineTool = Chart.GetTools().GetItems(lDrawLineTool).GetAsDrawLine();
cDrawLineTool.AddLine(5, 0, 5, 10);
cDrawLineTool.GetPen().SetStyle(psDash);
Thanks.

After initializing the chart you'll probably have to call InternalRepaint method. For example:
m_reschedChart.GetEnvironment().InternalRepaint();
so that OnAfterDraw event is fired.

Related

How to create boarders in a Table in SummerNote

When inserting a table into the editing area of Summernote editor, how do I outline the boarders of the table sections with a line? For example - the way Word does it's tables.
All help appreciated.
If you open Microsoft Word and insert a box, you will see that the boxes have boarders around them. SummerNote does display a very very faint line around the boxes of the table but on a white background it's impossible to see. I would like to draw darker and even thicker lines around the boxes. I would like to provide an example from Word but can't see a way to do it. Yes, I think I can edit CSS given some guidance.
Summernote calls tableClassName when table is created via jquery's addClass method. So I used that to inject my jquery code like this:
<script>
$('#xyz').summernote({
tableClassName: function()
{
$(this).addClass('table table-bordered')
.attr('cellpadding', 12)
.attr('cellspacing', 0)
.attr('border', 1)
.css('borderCollapse', 'collapse');
$(this).find('td')
.css('borderColor', '#ccc')
.css('padding', '15px');
},
});
</script>
Link for Information

Update whole data series for the graph

What I wanna do: I have a basic line chart which is initialy load with an array of data (series: [...]) which creates me lets say x lines. I will also render x checkboxes above the chart. On click on one of the checkboxes the corresponding line should disappear or appear. Therefor I am listening to the click event and then I want to add or remove a line.
The problem: I can not figure out how to replace the whole series with a new one. What I have found is the setData() method, but that only works on an item of the data array. I also found the methods addSeries() which will add an item. And remove() which will remove a specific item. The problem is, I dont know which item is which. What I would like is to hide a line or show them, but have the full x lines in the data series all the time. I think.
I also found the method update() which will let me pass a new configuration object to the chart, but its not working if i pass the option 'series: newData (array)'.
I am either looking for an option to pass the full data array at the beginning and then hide or show a line, or, to overwrite the full series data at any given them with a new array.
Hopefully thats understandable and someone can point out what I am missing! Thanks!
I have found a solution. I would load the whole data array in the beginning and show or hide certain series for the initial display with the option visible:false.
On click of the checkboxes I need to find the right series and then there are the methods show() and hide() to manipulate that visible property on runtime.
chart.series[myIndex].show();
chart.series[myIndex].hide();
You can use setVisible method for series and bind checkboxes with the series:
var checkboxes = document.getElementById('checkboxes').children;
for (var i = 0; i < checkboxes.length; i++) {
(function(i) {
checkboxes[i].addEventListener('change', function() {
chart.series[i].setVisible(this.checked);
});
})(i);
}
Live demo: http://jsfiddle.net/BlackLabel/ur31g4j5/
API Reference: https://api.highcharts.com/class-reference/Highcharts.Series#setVisible

Pie chart center click disable

When I clicks on pieChart chartValueSelected() method called. But now my need is when I click in center in pieChartView, there will be no action perform.
I don't know what kind of chart (or Library) you used.
In this situation, the contents of function you written seem not to matter.
So I will explain the general situation.
You can place a transparent button in the middle of the pie-chart.
Then link that button to your "chartValueSelected()" function.

Open Layers 3 - Initialize Draw Interaction with first node on LineString

I have a map where a user can choose some object/feature on the map and draw a line to another object/feature. When the user selects the feature i would like do add a draw interaction and already set the first point to the selected feature without the user having to click again on the map.
Here is a fiddle: Sample
The commented code below should be executed programmatically without user interaction, after pressing the draw button
geometryFunction: function (c, g) {
if (goog.isDef(g)) {
g.setCoordinates(c);
} else {
// DO THIS AUTOMATICALLY ON PRESSING DRAW
// TO INITIALIZE AND START THE DRAWING PROCESS
c[0][0] = 1174072.754460305;
c[0][1] = 332653.94709708635;
g = new ol.geom.LineString(c);
}
...
}
The current behaviour is that you click on the Draw button and can click on the map to start drawing (but i overwrite the first node with my desired starting location -- in this example near central africa)
Is it possible to click on Draw and the first node is already programmatically set, without having to click on map first?
It is not currently possible to do manually append points to the OpenLayers 3 ol.interaction.Draw, but it would make sense to be able to support it (in my mind). It would be "as-if" the user had clicked.
You should ask the OL3-dev mailing this about adding such a feature to see what they think about it. If they agree and you're willing to work on this, you could provide a pull request. See: https://groups.google.com/forum/#!forum/ol3-dev
If you don't mind using a private method in OL you can do this to achieve what you want.
var event = $.Event('click'); //create a click event in your draw method using JQuery
event.coordinate = [1174072.754460305,332653.94709708635];// set your starting coordinate
draw_interaction.startDrawing_(event);// tell your interaction to start drawing

Hiding a highchart series is very slow

I have a highchart displaying multiple series, each contains 100+ data points
I have a UI containing a checkbox for each series that when clicked calls the series.hide() or series.show() to toggle the hide/show of each line
My problem is that the hide and show are extremely slow such that I cant check one checkbox whilst processing from a previous is taking place
Does anyone know how to handle this?
Thanks
Rather than calling hide() for each series, call setVisible(false, false);. This second parameter is the redraw parameter, and you can avoid causing a redraw (which is slow) for each series.
Then, after you're done changing visibilities, call chart.redraw() once.
http://api.highcharts.com/highcharts#Series.setVisible
as answered in:
Hiding _groups_ of series in Highcharts and jQuery: how to get acceptable performance?
highcharts draw each time a show or hide is called;
disabling and enabling the redraw function worked for me;
var _redraw = this.chart.redraw;
this.chart.redraw = function(){};
//do work
this.chart.redraw = _redraw;
this.chart.redraw();
How about adding visible: false for the series that are hidden before calling Highcharts.chart()?
Please see references: 1. Highcharts API and 2. Demo
In my case, above approach showed the best performance comparing to the followings:
series.hide()
setVisible(false, false)
setVisible(false, true) or setVisible(false, false); redraw();

Resources