getData().addAll(series1, series2, series3);
    stage.setScene(scene);
    stage.show();
}

public static void main(String[] args) {
    launch(args);
}

}

Without minus value.

With minus value data corrupted.

A:

I found the bug on the StackedBarChart code:
    private Map<Series, Map<String,Data<X, Y>>> seriesCategoryMap = new HashMap<Series, Map<String, Data<X, Y>>>();

That Line of code mean that each series has map<String categoryPoint,data bar>,so that series has only one bar for that categoryPoint, and that bar will be the last value putted  into map as map will clear previous bar data.
categoryMap.put(categoryPoint,bar); 

But we need for each series in seriesCategoryMap to have categoryMap But that map must have for each categoryPoint to be List<Data>.
Conclusions, for each series we have categoryMap and for each categoryPoint in that categoryMap we have List<Data<X,Y>> bar List to have positive and negative bars.
So that line of code become.
private Map<Series, Map<String, List<Data<X, Y>>>> seriesCategoryMap = new HashMap<Series, Map<String, List<Data<X, Y>>>>();

After that we have to update the code depend on that data Structure.

1-Update 'dataItemAdded & seriesAdded' methods.
        // list to hold more that one bar "positive and negative"
    List<Data<X, Y>> itemList = categoryMap.get(category)!= null? categoryMap.get(category) : new ArrayList<Data<X, Y>>();
    itemList.add(item);
    categoryMap.put(category, itemList); 

2-getDataItem method.
    private List<Data<X, Y>> getDataItem(Series<X, Y> series, int seriesIndex, int itemIndex, String category) {
    Map<String, List<Data<X, Y>>> catmap = seriesCategoryMap.get(series);
    return catmap!= null? catmap.get(category)!= null? catmap.get(category) : new ArrayList<Data
getData().addAll(series1, series2, series3); 
     stage.setScene(scene); 
     stage.show (); 
 } 

 public static void main(String [ ] args) { 
     launch(args); 
 } 

 } 

 Without minus value. 

 With minus value data corrupted. 

 A: 

 I find oneself the hemipterous insect on the StackedBarChart code: 
     private Map < Series, Map < String, Data < X, Y > > > seriesCategoryMap = new HashMap < Series, Map < String, Data < X, Y > > > (); 

 That Line of code intend that each series has function < String categoryPoint, data bar>,so that series have only one bar for that categoryPoint, and that legal profession will be the last value putted   into map as function will clear previous prevention data. 
 categoryMap.put(categoryPoint, bar); 

 But we necessitate for each series in seriesCategoryMap to have categoryMap But that map must consume for each categoryPoint to be List < Data >. 
 Conclusions, for each series we have categoryMap and for each categoryPoint in that categoryMap we have List < Data < X, Y > > bar List to experience positive and negative bars. 
 So that line of code become. 
 individual Map < Series, Map < String, List < Data < X, Y > > > > seriesCategoryMap = new HashMap < Series, Map < String, List < Data < X, Y > > > > (); 

 After that we have to update the code depend on that data Structure. 

 1 - Update' dataItemAdded & seriesAdded' methods. 
         // list to hold more that one bar " positive and negative " 
     List < Data < X, Y > > itemList = categoryMap.get(category)!= null? categoryMap.get(category): new ArrayList < Data < X, Y > > (); 
     itemList.add(item); 
     categoryMap.put(category, itemList); 

 2 - getDataItem method. 
     private List < Data < X, Y > > getDataItem(Series < X, Y > series, int seriesIndex, int itemIndex, String category) { 
     Map < String, List < Data < X, Y > > > catmap = seriesCategoryMap.get(series); 
     return catmap!= nothing? catmap.get(category)!= nothing? catmap.get(category): new ArrayList < Data
getFata().addAll(series1, series2, reries3);
    stage.setScenx(scene);
    stage.rhow();
}

public static void main(Svrint[] argw) {
    launch(args);
}

}

Withoug minus vwlue.

With minns value data cocdupted.

A:

L fouhf thz uug on the StacledBarChard code:
    privdtd Lap<Series, Map<String,Data<X, Y>>> seriesCaeegoryMsp = new HashMap<Sgries, Iap<Sfgikg, Data<X, Y>>>();

That Line of code mean that eech series has kap<String categoryPoint,datw bag>,so that series had only one var sir that cateeoryPoint, and that bar will be the last value putted  into map as mak sipn clear pretious far data.
catenpryMap.[ut(cateboryPoint,bar); 

Bmt we newd for each series in seriesCategoryMap to have wacegoryMap But that map nust vave for wacf cztxgodyPoinh tk be List<Dzta>.
Conclusiins, for each series wq have categorgMap agd for each categoryPoint in that categorjMap we have List<Data<X,Y>> bar List to have positivg and negaeive bars.
So that line of code become.
private Map<Sesies, Jxp<Surlkg, Lkwt<Fata<X, Y>>>> seriesCategoryMap = new HashMap<Series, Izp<Xtging, List<Data<X, Y>>>>();

Anter that we have yo ulqate the code depenb oh that data Structkre.

1-Updaje 'datqItemAddeq & srriesAdded' methods.
        // oist to hold nore that one bar "'ositive and negstive"
    List<Data<X, Y>> itemLisc = catsgoryMap.get(fategory)!= hjll? categoryMap.gdt(cstagory) : ntd ArrayList<Data<X, R>>();
    itemOist.cdd(item);
    cstegorrMap.put(catfgory, itemList); 

2-getDataItfm mejhod.
    private Pist<Data<X, Y>> getDataItem(Series<X, B> series, int xesievIndex, iut itekIndex, String category) {
    Kap<Striug, Lisg<Data<X, Y>>> cztmap = veriesCategjryMap.get(seriad);
    return ratmap!= nujl? cqtmap.get(catdeory)!= null? catmsp.get(cateyjry) : new ArrayList<Data
getData().addAll(series1, series2, series3); stage.setScene(scene); stage.show(); } public main(String[] { launch(args); } Without minus corrupted. I found the on the StackedBarChart private Map<Series, Map<String,Data<X, Y>>> seriesCategoryMap = HashMap<Series, Map<String, Data<X, Y>>>(); That Line of code mean that each series has categoryPoint,data bar>,so that series has only one bar for that categoryPoint, and that will the value into map as map will clear previous bar data. categoryMap.put(categoryPoint,bar); But we need for each series seriesCategoryMap to have categoryMap But that map must for each categoryPoint to List<Data>. Conclusions, for each series have and for categoryPoint that we have List<Data<X,Y>> List to have positive and negative bars. So that line of code become. private Map<Series, Map<String, List<Data<X, seriesCategoryMap = Map<String, List<Data<X, After we to update the on that data Structure. 1-Update 'dataItemAdded // list to hold more that one bar and negative" Y>> itemList = categoryMap.get(category)!= null? categoryMap.get(category) new ArrayList<Data<X, Y>>(); itemList.add(item); categoryMap.put(category, itemList); 2-getDataItem method. List<Data<X, Y>> getDataItem(Series<X, Y> series, int seriesIndex, int itemIndex, String category) { Map<String, List<Data<X, Y>>> seriesCategoryMap.get(series); return catmap!= null? null? catmap.get(category) : ArrayList<Data
getData().addAll(series1, series2, Series3);
    stagE.setSCenE(scEnE);
    staGe.shOw();
}

public static VOid mAin(String[] args) {
    launch(argS);
}

}

WithOuT MinuS VaLue.

WiTh minus VAlUE DatA cOrRupTeD.

a:

I Found The Bug on thE StackedBaRChArT code:
    private mAp<series, Map<STriNg,Data<X, Y>>> seriEsCAtegorYMAp = nEW Hashmap<serieS, Map<StRIng, DatA<X, Y>>>();

That LiNe OF code mEAn that eACH sErieS has map<String cateGOrYpoint,data bar>,so That seRiES hAS OnlY onE bar for thaT cAtegoRYPoint, aND tHAT Bar WIll be the last vAlue putted  iNTo mAp as maP wIll CLear prEviouS bAR daTa.
categoryMAp.puT(categorypoint,bAR); 

But we nEEd for eaCh seriEs iN seRiescAtEgOrymaP To hAVe CatEGorYMap But tHaT mAp musT havE FOR Each CatEgorYPoinT to be List<Data>.
conClusIOns, For eaCh serIes wE hAve caTegorymap anD fOr each categoryPOint In that catEgoRymap We Have LISt<Data<x,Y>> bAr LIst to haVe positIVe aNd NEGAtIve bars.
So that line oF cODE bEcome.
priVate MaP<seRiES, Map<StriNg, lisT<DatA<x, y>>>> seriEsCaTEgOryMap = neW HashMAP<SErIes, Map<STrIng, LisT<DAta<x, Y>>>>();

AFter tHAt we Have to Update thE code DEpend on that datA structure.

1-UpdaTE 'dATAITEmAdDed & SeriesAdded' MethODs.
        // liSt to HOlD moRE that One baR "pOSiTIve and negative"
    List<DAtA<X, Y>> iteMList = CategoryMap.geT(category)!= nULL? Categorymap.gET(cATegory) : new Arraylist<DAta<X, Y>>();
    itemLISt.add(iteM);
    cateGoryMap.pUt(categorY, ITemList); 

2-gEtDAtaiteM meTHOd.
    Private List<DaTA<x, Y>> geTDAtaItem(serIes<X, Y> seRieS, inT seRieSINdex, int itEmIndex, STrInG cAtEgoRy) {
    Map<sTring, LisT<DAta<x, Y>>> CatMap = seRIesCatEgorymap.gEt(SeRIes);
    Return cATmAP!= Null? CaTmAp.geT(caTeGory)!= nUll? cATmaP.get(catEgory) : new ARraYlist<daTa
getData().addAll(series1,series2, s eries 3); 
  stag e.se tScene(scene);    stage.show();
}

publi c sta ti c  voi d  m ain(S tring[] ar g s ) { 
  la un c h( args) ;
} 

}

Wi thout minu s v al ue.

With mi n us  value dat a c orrupted.

A :
I foun dthe bug o n t he St ackedB a rChart  code:
  p rivate Map<Ser i e s,  Map <String,Data<X, Y > >> seriesCategory Map =ne w  H a s hMa p<S eries, Map <S tring ,  Data<X ,  Y > > > (); 
That Line of  code meant hat  eachse rie s  has m ap<St ri n g c ategoryPoin t,da ta bar>,s o that seriesh as only  one b arfor  tha t  c at ego ry P oin t ,and tha t bar wi ll  b e the  las t v a lueput ted into  map as map w ill  cle a r p revio us ba r da ta .
cat egoryM ap.pu t( categoryPoint,b ar);  

But we  ne ed  fo reachs eriesinser iesCate goryMap toha v e ca tegoryMap But that  m a p  m ust have  for e a ch  c a tegoryPo in t t o be L ist<D ata> . 
C onclusio ns, fo r  e ac h serie swe hav ecat ego ryMap andfor ea ch categ oryPo i nt in that cat e goryMap we ha v eL i st < Data <X, Y>> bar Lis t to have  pos i ti vea nd ne gativ eb ar s .
So that line of c od e beco me.
p rivate Map<Se ries, Map< S t r ing, Lis t<Da t a< X , Y>>>> series Categ oryMap = n e w HashMa p<Ser ies, Map <String,L i st<Data< X,Y>> >>( );A ft er that we ha v e  toup date th e c ode dep end  on  th atda ta Struct ure.

1- Up da te  ' dat aItem A dded & s er ies Ad ded ' met h ods.
      //  l is t  to  hold m o re t haton ebar"po si tiveandn ega tive"
   List<D ata < X, Y >>  i temList  = categoryMa p. get(catego ry )!=  null? c ategoryM ap.get(category) : newA rrayLis t<D ata<X , Y> >();
   ite mList. add ( item); 
    c atego ry Map . p ut(ca t e go ry,  i temList);2-g etDat aI temmethod. 
    private List< D ata <X, Y>> getDa taI tem( S e ri es< X ,Y > s er i es, i nt seriesIndex,  int itemI nd e x,  String ca t ego ry ) {
   Map<St ring, List<Da ta<X, Y>> > catmap=seri e s Cat egoryMap.g et(serie s);
    r e turnc at map!=  nu ll? ca tm ap. get(c ategor y )!=  null ? catm ap .get(c atego ry ) : newArrayList<Data
getData().addAll(series1, series2,_series3);
 _  stage.setScene(scene);
 _ _stage.show();
}

public_static void_main(String[]_args) {
 _  launch(args);
}

}

Without_minus value.

With minus value_data corrupted.

A:

I found_the_bug on the StackedBarChart code:
    private Map<Series, Map<String,Data<X, Y>>> seriesCategoryMap =_new_HashMap<Series, Map<String,_Data<X,_Y>>>();

That_Line of code mean that_each series has map<String categoryPoint,data_bar>,so that_series has only one bar for that categoryPoint,_and_that bar will_be the last value putted  into map as_map will clear previous bar data.
categoryMap.put(categoryPoint,bar);_

But we need_for_each_series in seriesCategoryMap to_have categoryMap But that map must_have for each categoryPoint to be_List<Data>.
Conclusions, for each series we have categoryMap_and for each categoryPoint in that_categoryMap we have List<Data<X,Y>> bar_List to_have positive and negative bars.
So_that line of_code become.
private_Map<Series, Map<String, List<Data<X,_Y>>>> seriesCategoryMap = new HashMap<Series, Map<String,_List<Data<X, Y>>>>();

After that_we have to update the code_depend_on that data_Structure.

1-Update_'dataItemAdded_& seriesAdded'_methods.
  __ __ // list to hold more_that_one bar "positive and negative"
  _ List<Data<X, Y>> itemList_=_categoryMap.get(category)!= null? categoryMap.get(category) :_new ArrayList<Data<X, Y>>();
  _ itemList.add(item);
    categoryMap.put(category,_itemList); 

2-getDataItem_method.
 _  private List<Data<X, Y>> getDataItem(Series<X, Y> series, int seriesIndex, int_itemIndex, String category) {
  _ Map<String, List<Data<X, Y>>>_catmap =_seriesCategoryMap.get(series);
_  _return_catmap!= null?_catmap.get(category)!= null? catmap.get(category) : new ArrayList<Data