I'm using 32x32 and 64x64 (retina) for the same icon. When I tried using SKAnnotationView to display my icon, it loads up in double size (128x128). After I clear annotations and add again, the size returns to normal (64x64).
Please find the code below, I followed the sample project code:
SKAnnotation annotation = new SKAnnotation();
annotation.setUniqueID(-1);
annotation.setLocation(new SKCoordinate(longitude.doubleValue(), latitude.doubleValue()));
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
SKAnnotationView annotationView = new SKAnnotationView();
if (metrics.densityDpi < DisplayMetrics.DENSITY_HIGH) {
annotationView.setDrawableResourceId(R.drawable.ic_annotation);
annotation.setOffset(new SKScreenPoint(16, 16));
annotationView.setWidth(32);
annotationView.setHeight(32);
annotation.setImageSize(32);
} else {
annotationView.setDrawableResourceId(R.drawable.ic_annotation_retina);
annotation.setOffset(new SKScreenPoint(32, 32));
annotationView.setWidth(64);
annotationView.setHeight(64);
annotation.setImageSize(64);
}
annotation.setAnnotationView(annotationView);
mapView.addAnnotation(annotation, SKAnimationSettings.ANIMATION_NONE);
It might be too late , but you can try adding annotation at
#Override
public void onSurfaceCreated() {
}
callback.
This is my code :
public class OfflineMapFragment extends BaseFragment implements SKMapSurfaceListener {
private void addFilteredAnnotations(){
SKAnnotation annotation = new SKAnnotation();
annotation.setUniqueID(15);
annotation.setLocation(new SKCoordinate(Double.parseDouble(lat,long);
annotation.setMininumZoomLevel(5);
annotation.setOffset(new SKScreenPoint(128, 128));
SKAnnotationView annotationView = new SKAnnotationView();
annotationView.setDrawableResourceId(R.drawable.map_icon);
annotationView.setWidth(128);
annotationView.setHeight(128);
annotation.setAnnotationView(annotationView);
mapView.addAnnotation(annotation, SKAnimationSettings.ANIMATION_NONE);
}
#Override
public void onSurfaceCreated() {
addAnnotation();
}
}
Related
I want to create a modular class that I can use anytime I want to scan a barcode. Is this possible using Firebase ML Kit?
This is what I've got so far:
public List<FirebaseVisionBarcode> ScanBarcode(int... barcodeFormats)
{
//region Init, config and execution of the barcode scanning
final FirebaseVisionBarcodeDetectorOptions.Builder BUILDER =
new FirebaseVisionBarcodeDetectorOptions.Builder();
//Set barcode formats based on arguments
for (int formats : barcodeFormats)
{
BUILDER.setBarcodeFormats(formats);
}
final FirebaseVisionBarcodeDetectorOptions OPTIONS = BUILDER.build();
final FirebaseVisionImage IMAGE = FirebaseVisionImage.fromBitmap(bitmap);
final FirebaseVisionBarcodeDetector DETECTOR = FirebaseVision.getInstance()
.getVisionBarcodeDetector(OPTIONS);
DETECTOR.detectInImage(IMAGE)
.addOnSuccessListener(new OnSuccessListener<List<FirebaseVisionBarcode>>()
{
#Override
public void onSuccess(List<FirebaseVisionBarcode> _barcodes)
{
barcodes = _barcodes;
}
})
.addOnFailureListener(new OnFailureListener()
{
#Override
public void onFailure(#NonNull Exception e)
{
barcodes = new ArrayList<>();
}
});
//endregion
return barcodes;
Mostly taken from https://firebase.google.com/docs/ml-kit/
The problem here is that the listener, for the DETECTOR, is some kind of async call. Which means that it will return before onSuccess is called.
The barcode scanning part works, but I'm having a hard time wrapping it in a class of it's own.
Thanks.
I figured it out. Not sure if it's the best approach class structure wise, but it works quite nice.
public Task<List<FirebaseVisionBarcode>> ScanBarcode(int... barcodeFormats)
{
//region Init, config and execution of the barcode scanning. Mostly taken from https://firebase.google.com/docs/ml-kit/
final FirebaseVisionBarcodeDetectorOptions.Builder BUILDER =
new FirebaseVisionBarcodeDetectorOptions.Builder();
//Set barcode formats based on arguments
for (int formats : barcodeFormats)
{
BUILDER.setBarcodeFormats(formats);
}
final FirebaseVisionBarcodeDetectorOptions OPTIONS = BUILDER.build();
final FirebaseVisionImage IMAGE = FirebaseVisionImage.fromBitmap(bitmap);
final FirebaseVisionBarcodeDetector DETECTOR = FirebaseVision.getInstance()
.getVisionBarcodeDetector(OPTIONS);
final Task<List<FirebaseVisionBarcode>> DETECT_IMG_TASK = DETECTOR.detectInImage(IMAGE)
.addOnSuccessListener(new OnSuccessListener<List<FirebaseVisionBarcode>>()
{
#Override
public void onSuccess(List<FirebaseVisionBarcode> _barcodes)
{
barcodes = _barcodes;
}
})
.addOnFailureListener(new OnFailureListener()
{
#Override
public void onFailure(#NonNull Exception e)
{
barcodes = new ArrayList<>();
}
});
return DETECT_IMG_TASK;
//endregion
}
public List<FirebaseVisionBarcode> GetBarcodes()
{
return barcodes;
}
detectInImage returns a Task. What I did was return this task. Once this task completes, you can call GetBarcodes to obtain the parsed data. I hate to force calling additional methods to get the final results, but it was the only way I could get it to work.
I'm using FFImageLoading for developing a Xamarin.Forms apps on iOS and Android. On iOS it works fine. But on Android, it always crashes after a while.
The app uses a simple ListView with "CachedImage" elements in each cell.
My app crashes with this error: "Java.Lang.RuntimeException: Canvas: trying to use a recycled bitmap"
I use FFImageLoading in a simple Listview with a custom Cell.
This is the crash log:
Java.Lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap#f41b99a
...
at java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap#f41b99a
at at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1270)
at at android.graphics.Canvas.drawBitmap(Canvas.java:1404)
at at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:544)
at at android.widget.ImageView.onDraw(ImageView.java:1244)
at at android.view.View.draw(View.java:16178)
at at android.view.View.updateDisplayListIfDirty(View.java:15174)
at at android.view.View.draw(View.java:15948)
at at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at at android.view.View.updateDisplayListIfDirty(View.java:15169)
... (cut)
My XAML main Page:
<ContentPage
xmlns:cells="clr-namespace:MyApp;assembly=MyApp"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.SamplePage"
Title="SamplePage">
<ContentPage.Content>
<ListView
x:Name="MediaItemsListView"
BackgroundColor="Transparent"
SeparatorVisibility="None"
HorizontalOptions="Center"
VerticalOptions="Start"
Margin="15,0,0,0"
RowHeight="255">
<ListView.ItemTemplate>
<DataTemplate>
<cells:CellEvento />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage.Content>
</ContentPage>
This is the main Page codebehind:
public partial class SamplePage : ContentPage
{
public SamplePage ()
{
InitializeComponent ();
MediaItemsListView.ItemsSource = DataProvider.GetMediaItems ();
}
}
This is the custom Cell XAML:
<ViewCell x:Class="MyApp.CellEvento"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:fftransformations="clr-namespace:FFImageLoading.Transformations;assembly=FFImageLoading.Transformations"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:MyApp="clr-namespace:MyApp;assembly=MyApp">
<AbsoluteLayout WidthRequest="344"
HeightRequest="244"
BackgroundColor="White" >
<ffimageloading:CachedImage x:Name="ImageView"
AbsoluteLayout.LayoutBounds="0,48,144,152"
AbsoluteLayout.LayoutFlags="None"
DownsampleToViewSize="true"
LoadingPlaceholder="PlaceholderEventBadgePhotoGrayS.png" />
<ffimageloading:CachedImage x:Name="UserThumbnailView"
WidthRequest="24"
HeightRequest="24"
AbsoluteLayout.LayoutBounds="298,211,24,24"
AbsoluteLayout.LayoutFlags="None"
DownsampleToViewSize="true"
LoadingPlaceholder="PlaceholderEventBadgePhotoGrayS.png">
<ffimageloading:CachedImage.Transformations>
<fftransformations:CircleTransformation />
</ffimageloading:CachedImage.Transformations>
</ffimageloading:CachedImage>
</AbsoluteLayout>
</ViewCell>
This is the custom cell codebehind:
public partial class CellEvento : ViewCell
{
public CellEvento ()
{
InitializeComponent ();
}
protected override void OnBindingContextChanged ()
{
base.OnBindingContextChanged ();
var mediaItem = BindingContext as MediaItem;
if (mediaItem != null)
{
ImageView.Source = mediaItem.ImagePath ?? "";
UserThumbnailView.Source = mediaItem.AvatarPath ?? "";
}
}
}
This is the data provider class:
public static class DataProvider
{
public static ObservableCollection<MediaItem> GetMediaItems ()
{
ObservableCollection<MediaItem> items = new ObservableCollection<MediaItem> ();
int counter = 0;
for (int index = 0; index < 20; index++) {
for (int i = 0; i < 20; i++) {
var item = new MediaItem (
"Image n." + counter,
GetRandomImageUrlFlickr (288, 304),
GetRandomAvatarPhotoUrlFlickr (120, 120),
counter);
items.Add (item);
counter++;
}
}
return items;
}
public static string GetRandomImageUrlFlickr (int width, int height)
{
return string.Format ("http://loremflickr.com/{1}/{2}/nature?filename={0}.jpg", Guid.NewGuid ().ToString ("N"), width, height);
}
public static string GetRandomAvatarPhotoUrlFlickr (int width, int height)
{
return string.Format ("http://loremflickr.com/{1}/{2}/girl,face/all?filename={0}.jpg", Guid.NewGuid ().ToString ("N"), width, height);
}
}
And this is the mediaitem class:
public class MediaItem
{
public string Name { get; set; }
public int Index { get; set; }
public string ImagePath { get; set; }
public string AvatarPath {get; set; }
public MediaItem (string Name, string imagePath, string string avatarPath, int counter)
{
this.ImagePath = imagePath;
this.AvatarPath = avatarPath;
this.Name = counter.ToString ();
this.Index = counter;
}
public override string ToString ()
{
return string.Format ("[MediaItem: Name={0}]", Name);
}
}
It is a pretty basic setup of a Xamarin.Forms app. The code is almost all in the shared part of the App. As I said the app works fine on iOS. But on Android it crashes.
The Droid project in my Xamarin Studio IDE was pretty basic. I just added the placeholder png to the drawable, and added this initialization code to the MainActivity OnCreate method:
//FFImage platform specific initialization code for Droid------
FFImageLoading.Forms.Droid.CachedImageRenderer.Init ();
var circlee = new FFImageLoading.Transformations.CircleTransformation ();
var config = new FFImageLoading.Config.Configuration () {
VerboseLogging = true,
VerbosePerformanceLogging = true,
VerboseMemoryCacheLogging = true,
VerboseLoadingCancelledLogging = true,
Logger = new CustomLogger (),
MaxMemoryCacheSize = 10,
};
ImageService.Instance.Initialize (config);
//-----------------------------------
And of course I tried to remove the CircleTrasformation, but it makes no difference. After a few seconds of scroll, the app crashes.
The Android emulators I tried are many: official emulator of a Nexus 5 (standard setup, v19), Nexus 5 (with android v23), and Genymotion Nexus 5 (with android v19), and some more. All gives the same result: crash when scrolling after 2-5 seconds.
What is puzzling me is that, differently from other questions with similar errors here on SO, I don't explicitly call any Recycle command. I let the Listview class handle the recycling by itself.
What I'm missing here?
Any help is appreciated, thanks.
UPDATE: I opened the issue on the ffimageload github repo:
https://github.com/luberda-molinet/FFImageLoading/issues/297
I am trying to create image using http://www.hypeframework.org/ and processing.org. I want to create the image and store in a folder then display it on the web using java spark. The following are the steps that I started with.
Create maven project using NetBeans
Added processing.org, spark libraries in maven
Downloaded hype processing jar added to my libraries
My question is how do I create image with then save it to the webapp folder? I am relatively new to hype and processing drawing shapes stuff. The following are my code that I put together:
Right now this cimg.setup() in the main spark controller throws java.lang.NumberFormatException: For input string: "#BC7A38,#996A37,#968063,#AB977C,#997949,#AE9162,#DFC597,#CAB790" error.
I searched google, but can't find any lead. Any help on how I should accomplish my task is greatly appreciated. Thanks!
//-- spark controller -
public class Main {
public static void main(String[] args) {
get("/", new TemplateViewRoute() {
#Override
public ModelAndView handle(Request req, Response res) throws Exception {
HashMap model = new HashMap();
HypeProcessing cimg = new HypeProcessing();
cimg.setup();
model.put("template", "templates/form.vtl");
return new ModelAndView(model, "templates/layout.vtl");
}
}, new VelocityTemplateEngine());
}
}
//--- HypeProcessing class ----
public class HypeProcessing extends PApplet
{
HDrawablePool pool;
HColorPool colors;
#Override
public void setup()
{
int h = 300;
int w = 300;
//size(w, h);
//H.init(this).background(Integer.parseInt("#202020"));
//smooth();
colors = new HColorPool(Integer.parseInt("#BC7A38,#996A37,#968063,#AB977C,#997949,#AE9162,#DFC597,#CAB790"));
pool = new HDrawablePool(121);
pool.autoAddToStage()
.add(new HShape("svg1.svg"))
.add(new HShape("svg2.svg"))
.add(new HShape("svg3.svg"))
.add(new HShape("svg4.svg"))
.add(new HShape("svg5.svg"))
.add(new HShape("svg6.svg"))
.layout(
new HGridLayout()
.startX(50)
.startY(50)
.spacing(50,50)
.cols(11)
)
.onCreate(
new HCallback() {
#Override
public void run(Object obj) {
HShape d = (HShape) obj;
d
.enableStyle(false)
.strokeJoin(ROUND)
.strokeCap(ROUND)
.strokeWeight(1)
.stroke(Integer.parseInt("#000000"))
// .anchorAt(H.CENTER)
.rotate( (int)random(4) * 90 )
.size( 50 + ( (int)random(4) * 50 ) ) // 50, 100, 150, 200
;
d.randomColors(colors.fillOnly());
}
}
)
.requestAll();
saveImage(w,h);
noLoop();
// ...
}
#Override
public void draw()
{
//rect(10, 10, 80, 80);
H.drawStage();
// ...
}
public void saveImage(int width, int height)
{
//Helper c = new Helper();
String p = "webapp/images/";
String fn = p+"image_"+Helper.generateRandomNumber();
PGraphics img = createGraphics(width, height);
img.beginDraw();
boolean use3D = false;
float alpha = 1;
H.stage().paintAll(img, use3D, alpha);
img.endDraw();
img.save(fn);
}
}
Processing uses a custom color type. You can use web notation like #ff00ff, and under the hood Processing stores that as an integer, so you can even do things like:
int c = #ff00ff;
However, Java functions like Integer.parseInt() have no idea how to handle web notation. Java has no way of mapping a String like "#ff00ff" to an int value. This is why you're getting your error.
Even if Java did know how to map web notation to an int value, you're passing in multiple values within a single String, which doesn't make a ton of sense.
But the point is, you can only use web notation if you're using the Processing editor. If you're writing this in something other than the Processing editor, you'll have to use the color() function.
HColorPool(color(0, 255, 0), color(255, 0, 255), ...);
There is java code for the translation:-
java.awt.Color.decode("ff00ff").getRGB();
Its a bit obscure is what I use in JRubyArt
So I'm having a heck of a time creating a Datagrid with GWT. I've created my table according the the docs for GWT, and I've added my data, but I can't get it or the datagrid itself to show up at all. What am I missing? I feel I've been tearing my hair out over this. I feel like making an aysnc call might be an issue, but I get no errors. When i compile and execute this portion of my code nothing shows up on the screen and the area where the datagrid is supposed to be on the dock is empty. Am I forgetting something trivial?
static int orderID = 1001;
private static List<OrderLine> orderLineList = new ArrayList<OrderLine>();
final DataGrid<OrderLine> dgOrder = new DataGrid<OrderLine>();
dgOrder.setWidth("100%");
//set columns
TextColumn<OrderLine> orderLineIdColumn = new TextColumn<OrderLine>(){
#Override
public String getValue(OrderLine object) {
return Integer.toString(object.getOrderLineID());
}
};
dgOrder.addColumn(orderLineIdColumn, "OrderLine ID");
TextColumn<OrderLine> productColumn = new TextColumn<OrderLine>(){
#Override
public String getValue(OrderLine object) {
return getProductName(object.getProductNumber());
}
};
dgOrder.addColumn(productColumn, "Product");
TextColumn<OrderLine> quantityColumn = new TextColumn<OrderLine>(){
#Override
public String getValue(OrderLine object) {
return Integer.toString(object.getQuantity());
}
};
dgOrder.addColumn(quantityColumn, "Quantity");
// add data to datagrid
Ioma.dataservice.getOrderLines(orderID, new AsyncCallback<ArrayList<OrderLine>>(){
#Override
public void onFailure(Throwable caught) {// TODO Auto-generated method stub
System.out.println("error in retrieving GP.getOrderLines" + caught.toString());
}
#Override
public void onSuccess(ArrayList<OrderLine> result) {
// TODO Auto-generated method stub
//yes i realize I could also set it to "result" but I use the result in other places as well, I have also tried setting it to result with no success
orderLineList = result;
dgOrder.setRowData(0, orderLineList);
}
});
//add datagrid to the dock
dock.add(dgOrder, DockPanel.EAST);
//add dock to mainPanel
return dock;
When you use the DataGrid you need to give it an explicit size. For CellTable you don't need to so that's why it worked.
When you were using the DataGrid is was there but had both height and width of 0. So you either need to explicitly set the size:
DataGrid<OrderLine> grid = new DataGrid<OrderLine>;
grid.setWidth("500px");
grid.setHeight("600px");
dock.add(dgOrder, DockPanel.EAST);
or you can put the gird in a ProvidesResize widget. So in your case I believe you can make it work with a DockLayoutPanel as opposed to a DockPanel which is what you seem to be using.
I had a smilliar problem . Try to put the datagrid in a Panel that implements the ProvidesResize interface, like SimpleLayoutPanel. Also in my case it helped to set the size of the SimpleLayoutPanel.
Turns out my problem was my declaration.
final DataGrid<OrderLine> dgOrder = new DataGrid<OrderLine>();
should be
final CellTable<OrderLine> dgOrder = new CellTable<OrderLine>();
I can't find out why this works, but it does. I can see my table now. are you not supposed to explicitly call an instance of datagrid I wonder?
My problem is annoying. My server side is generating 12 random numbers (double here).
My Client side received the correct data but nothing is displayed in my Chart. That worked fine with hardcoded data in the store but not with a REST call.
The transfer between my server and my client is that :
[{"key":"key0","value":0.47222548599297787},{"key":"key1","value":0.6009173797369691},{"key":"key2","value":0.13880104282435624},{"key":"key3","value":0.01804674319345545},{"key":"key4","value":0.5547733564202956},{"key":"key5","value":0.8229999661308851},{"key":"key6","value":0.8959346004391032},{"key":"key7","value":0.6848052288628435},{"key":"key8","value":0.10222856671111813},{"key":"key9","value":0.6931371931409103},{"key":"key10","value":0.2994297934549003},{"key":"key11","value":0.47566752196381334}]
Here my simple class used for my test. I am a newbie with GXT 3
public void onModuleLoad() {
final ListStore<JSOModel> store;
final ContentPanel panel = new FramedPanel();
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, "/ws/DocumentService/v1/test");
builder.setHeader("Accept", "application/json");
HttpProxy proxy = new HttpProxy(builder);
final Loader<ListLoadConfig, ListLoadResult<JSOModel>> loader = new ListLoader<ListLoadConfig, ListLoadResult<JSOModel>>(proxy, new DataReader<ListLoadResult<JSOModel>, String>() {
#Override
public ListLoadResult<JSOModel> read(Object loadConfig, String data) {
List<JSOModel> jsoModels = new ArrayList<JSOModel>();
JsArray<JSOModel> jsoModelJsArray = JSOModel.arrayFromJson(data);
if(jsoModelJsArray != null) {
for(int i = 0; i < jsoModelJsArray.length(); i++) {
jsoModels.add(jsoModelJsArray.get(i));
}
}
return new ListLoadResultBean<JSOModel>(jsoModels);
}
});
store = new ListStore<JSOModel>(new ModelKeyProvider<JSOModel>() {
#Override
public String getKey(JSOModel item) {
return item.get("key");
}
});
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, JSOModel, ListLoadResult<JSOModel>>(store) {
#Override
public void onLoad(LoadEvent<ListLoadConfig, ListLoadResult<JSOModel>> event) {
ListLoadResult<JSOModel> loaded = event.getLoadResult();
if(loaded.getData() == null) {
store.replaceAll(new ArrayList<JSOModel>());
} else {
store.replaceAll(loaded.getData());
}
}
});
Chart<JSOModel> chart = new Chart<JSOModel>();
chart.setStore(store);
chart.setShadowChart(true);
NumericAxis<JSOModel> axis = new NumericAxis<JSOModel>();
axis.setPosition(Chart.Position.LEFT);
axis.addField(new ValueProvider<JSOModel, Number>() {
#Override
public Number getValue(JSOModel JSOModel) {
return JSOModel.getNumber("value");
}
#Override
public void setValue(JSOModel JSOModel, Number number) {
}
#Override
public String getPath() {
return "key";
}
});
axis.setTitleConfig(new TextSprite("Number of hits"));
axis.setWidth(50);
axis.setMinimum(0);
axis.setMaximum(100);
chart.addAxis(axis);
PathSprite odd = new PathSprite();
odd.setOpacity(1);
odd.setFill(new Color("#dff"));
odd.setStroke(new Color("#aaa"));
odd.setStrokeWidth(0.5);
axis.setGridOddConfig(odd);
CategoryAxis<JSOModel, String> horizontalAxis = new CategoryAxis<JSOModel, String>();
horizontalAxis.setPosition(Chart.Position.BOTTOM);
horizontalAxis.setField(new ValueProvider<JSOModel, String>() {
#Override
public String getValue(JSOModel JSOModel) {
return JSOModel.get("key");
}
#Override
public void setValue(JSOModel JSOModel, String s) {
}
#Override
public String getPath() {
return "key";
}
});
horizontalAxis.setTitleConfig(new TextSprite("month of year"));
chart.addAxis(horizontalAxis);
LineSeries<JSOModel> column = new LineSeries<JSOModel>();
column.setYAxisPosition(Chart.Position.LEFT);
column.setStroke(new RGB(148,174,10));
column.setHighlighting(true);
chart.addSeries(column);
axis.addField(column.getYField());
chart.addSeries(column);
chart.setHeight(100);
chart.setWidth(100);
Button b = new Button("ha");
b.addClickHandler(new ClickHandler() {
#Override
public void onClick(ClickEvent clickEvent) {
loader.load();
}
});
RootPanel.get().add(b);
panel.setCollapsible(true);
panel.setHeadingText("Column Chart");
panel.setPixelSize(620, 500);
panel.setBodyBorder(true);
VerticalLayoutContainer layout = new VerticalLayoutContainer();
panel.add(layout);
chart.setLayoutData(new VerticalLayoutContainer.VerticalLayoutData(1,1));
layout.add(chart);
chart.setBackground(new Color("#dff"));
RootPanel.get().add(panel);
There are two ways to wire the chart into a store. One is to simply specify that the chart is using a store via setStore, as you have done:
chart.setStore(store);
When you do this, you must also inform the chart when it must redraw everything - you must call:
chart.redrawChart();
This call must be made shortly after the load is completed - consider doing it at the end of onLoad.
Why is this required? In some cases, developers want to make many changes to the store, one at a time, and if the chart automatically updated after each change, that would spawn many slow changes to the data model, and could end up looking strange. In a case like this, you would only call redrawChart() after all changes were complete.
There is another option however - instead of calling setStore, you can call bindStore, and ask the Chart to automatically update whenever any change occurs to the chart:
chart.bindStore(store);
In your case, this is likely the correct answer.