Two scicharts bound to the same SeriesSource, not updating - scichart

I'm using SciChart v3.1 and I have a requirement to display two charts on the same window (in different tabs), both displaying the same data. I'm plotting data "real time" (adding a new point every second), but I'm finding that new values don't appear on the charts as they are added to the bound series. I've found that I can get the charts to refresh by recreating the VisibleRange that is bound to the charts' Y axis, but this isn't ideal.
Things work fine if there is only one chart on the window, so the issue seems to point to using two charts. Any thoughts? I appreciate I'm on an older version but curious if this is a known issue, and whether there is a workaround.

In SciChart v3, the SeriesSource API binds to an ObservableCollection of IChartSeriesViewModel. Each IChartSeriesViewModel contains both DataSeries and BaseRenderableSeries (which is a framework element).
Hence, your chart actually has WPF FrameworkElements on two charts (two visual parents) - a big no-no for WPF terms.
This was a known issue in SciChart v3, and as a result the SciChart team re-wrote this API in version 4 of SciChart.
The new MVVM API: SeriesBinding, completely separates View from ViewModel so that you can bind multiple charts to the same set of ViewModels and it will work as expected.
Workaround for v3. Ensure you have new IChartSeriesViewModel and RenderableSeries for each chart. DataSeries may still be shared.

Related

Creating a Google Maps application

I have been behind the 8-ball all quarter for my class some how I am supposed to be able to do this in 4 hours.
My Assignment
The purpose of this assignment is to utilize a map to display a route using overlays/polylines.
The goal of this assignment is to enhance the assignment from week 5 (web service to retrieve directions) to display the retrieved directions as a route on a map in addition to a list of steps.
You are required to write a single application that runs on a tablet configuration (Nexus 10 or some variation of a 10 inch screen tablet)
User Interface Requirements
The left side of the screen (ListView, left-pane) will contain the interface outlined in the week 5 assignment. A user can enter a source and destination and retrieve a list of directions based on that input. So, the interface is a couple textfields, a button, and a list.
The right side of the screen (right-pane, details view) will contain a Map that displays the directions as a segmented line (route). The map and route gets updated/displayed after the directions are retrieved (selection of the button). An initial map should be displayed with some default settings when the screen is first loaded.
Other Requirements
The Map should display the entire route (start and end point) at the appropriate zoom level (depending on the distance). The correct map type should also be used depending on the distance.
You are required to use a Marker to display the starting point and ending destination.
You are required to use the MapFragment class.
You are required to use API V2 from Google Maps and the Google Play Services API.
You are required to use the XMLPullParser class for parsing the XML.
This application will look very similar to the Google maps application that is used on the web (with a lot less detail, no zooming in out of the map, etc), concerning the route displayed, and left pane to enter source / destination and direction list.
Using Android Studio I have tried Creating an Application using the Map Activity, but it creates and application that will not compile and it looks like it wants me to use Google Keys. I can't hand in an assignment that requires Keys assigned to me.
I already have 4 hours into this and I can't even get started. I read that v3 of googles map API's doesn't need keys, but I can't find anything that tells me how to use them and Android Studio Doesn't seem to give you options as to what to download and use.
I really need help.

What is the difference between new GoogleEarth(map) and google.earth.createInstance(....)

What is the difference between new GoogleEarth(map) and google.earth.createInstance(....)? We are trying to incorporate Google Earth into what is effectively a legacy application which does however use Google Maps. When developed it seems they had Google Earth in mind as there is the following code snippet:
if (google.earth && google.earth.isInstalled()) {
var ge = new GoogleEarth(map);
We have a menu-ing system for maps that adds selection based on map types and this adds an entry for Google Earth automatically; when chosen however despite the controls showing up just like for our other maps, we get only a white screen.
Alternately we have tried google.earth.createInstance and the interface seems different from the other map types (road, terrain, satellite). For instance, to zoom it seems we must use lookAt.setRange. Furthermore the Google Earth map does not get added to our menu but at least the map works.
Is new GoogleEarth(map) deprecated? Is the instance returned by google.earth.createInstance no longer a bona fide "map type"?
What is the difference between...
google.earth.createInstance is the method in the Google Earth API for creating the GEPlugin object.
new GoogleEarth(map) is the initialisation for the GEPlugin object within the google-maps-utility-library. It is essentially allows you to create objects (markers, geometry) that persist when switching between the Google Earth API and Google Maps API.
Is new GoogleEarth(map) deprecated?
No. Here is a working example
Is the instance returned by google.earth.createInstance no longer a bona fide "map type"?
It is, and always was, the GEPlugin object - it was never a "map type". I believe the "map type" used by the library for the earth layer is "GoogleEarthAPI".

Is there any alternative to GViz on Google Apps Script?

The problems:
I need to get data in a kind of "relational" way.
GViz (Google Visualization API) is not available for GAS (Google Apps Script) HTML Service (see here: Can we use Google Chart Tools with Google Script HtmlService).
Getting all the functinality GViz delivers is a dream right now, so, instead, I'd be satisfied with DataTable and DataView objects and google.visualization.data.join(). I dont need charts right now.
All of this, as long as I cannot get full GViz on the client side, could be server side.
Being more explicit, I need to join some queries and not mess up with the normalized data.
Keep in mind that I'm using a Spreadsheet as a data container (the tables are composed of static and dynamic data).
Getting all the functionality from GViz is everyone's dream right now, but some of it is available through Charts Services in UiApps. I have no experience with HTML Service, so I can't speak for that.
https://developers.google.com/apps-script/service_charts
If you're manipulating a lot of data, have you looked at ScriptDB?
https://developers.google.com/apps-script/service_scriptdb
I currently use a set of spreadsheets and Charts Services for a dashboard and it works pretty well. I really wish I could make combo charts, though.
It looks like sometime between mid-March and now, GViz mostly works with HTML Service.
I'm very new to Google Apps Script myself, but I have managed to get TaffyDB working server side. I loaded it up as a library in case I want to use it across multiple projects.
I did have to add this line to make it work server side:
function setTimeout() {}
Not sure if the is necessarily sufficient, but it worked as a starting point.

Google or Bing maps API - creating and using your own map

What I need is the following.
Whenever I add any instance of object in my website, I need the server to add the location of the object to my own map either in Google maps or Bing maps (Bing maps docs are more clear therefore I'm going to use Bing).
Later, whenever I view the object in my site, the map should point to the location of the object and other my map objects in the same map.
How can this be achieved? Do I need to hold all the coordinates and object descriptions in my server, or somehow it is saved in the google or bing.
I went through the docs, but couldn't find any information I need.
You need to store them on your server and load them into the map on your webpage. There are ways with both google (fusion tables) and bing (spatial data services) of storing them with the provider but if you are already storing a copy for your website you are better off keeping them there for the map rather than maintaining two copies.
I'm not sure how technical you are but this best architecture approach is this:
1) Write a database query that finds objects to show on your map, ideally filtered by whatever the user can use to filter objects elsewhere on your site. Add to this query a filter by geographical bounding box (the range of latitude and longitude that can be seen on your map at any one point). The bounding box filter is just a simple sql BETWEEN clause but will mean you dont have to load every single object on to the map.
2) write a "webservice" that uses the database query in 1) and turns the results into JSON. This approach will lead to a much cleaner seperation between your mapping code in javascript and your server side code in the webservice.
3) Write your mapping frontend in Bing using javascript and use something like Jquery to read data from the webservice as the map is moved around re-load data that know should be shown on the new map view. As the data will be in JSON its much easier as JSON will just give you javascript versions of your objects

Display country names in Google Maps

I have code like this that sets the map type to Terrain View:
map = new GMap2(document.getElementById("map_canvas"));
map.setMapType(G_PHYSICAL_MAP); //Terrain View
The G_PHYSICAL_MAP type used to display the country names, so Google must have changed this recently. Is there a way to add the country names back?
This is how the terrain map looks now without country names:
Current Terrain View http://img413.imageshack.us/img413/3756/terrnoname.jpg
This is how it was a few weeks ago:
Terrain View with Country Names http://img13.imageshack.us/img13/2466/googlemapsterrain21.png
Thanks.
The country names on the terrain map were part of the map imagery (before they disappeared). Unfortunately there seems to be no way to request different map imagery that includes country names.
The only option I see is to define your own map overlay on top of the terrain map, with all the country names. (Probably not practical and not easy).
1st EDIT: As suggested in a comment below, if you plan to add large overlays over the terrain map, you may want to use the open-source tool MapTiler (for Windows and Mac OS X). MapTiler will automate the tiling process for you, and in addition, once the tiling process is finished, it will generate a simple HTML viewer. If you are adding the name of just one country, you may want to use the GGroundOverlay instead. (Google Demo)
2nd EDIT: Note that this issue has been acknowledged by a Google employee on January 20th, and therefore you may want to consider waiting for a few days to see if it gets sorted automatically, before you commit your time to fix it.
3nd EDIT: This has been fixed a few weeks ago by Google.