<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">

  <module name="studio" package="com.axelor.studio.db" />
  
  <entity name="ChartBuilder" cacheable="true">
    <string name="title" title="Title" required="true" />
    <string name="name" title="Name"  required="true" unique="true"/>
    <string name="model" title="Model" />
    <boolean name="isJson" title="Json" />
    <one-to-many name="filterList" title="Filters" ref="com.axelor.studio.db.Filter" mappedBy="chartBuilder" />
    <many-to-one name="aggregateOn" title="Aggregate On" ref="com.axelor.meta.db.MetaField"/>
    <boolean name="isJsonAggregateOn" title="Json" />
    <many-to-one name="aggregateOnJson" title="Aggregate On" ref="com.axelor.meta.db.MetaJsonField"/>
    <string name="aggregateOnTarget" title="Target" /> 
    <string name="aggregateOnTargetType" title="Aggregate On type" /> 
    <string name="aggregateDateType" selection="studio.chart.builder.date.type" />
    <many-to-one name="groupOn" title="Group By" ref="com.axelor.meta.db.MetaField" />
    <boolean name="isJsonGroupOn" title="Json" />
    <many-to-one name="groupOnJson" title="Group By" ref="com.axelor.meta.db.MetaJsonField" />
    <string name="groupOnTarget" title="Target" />
    <string name="groupOnTargetType" title="Group on type" />
    <string name="groupDateType" selection="studio.chart.builder.date.type" />
    <many-to-one name="displayField" title="Display" ref="com.axelor.meta.db.MetaField" />
    <integer name="displayType" selection="studio.chart.builder.display.type" />
    <boolean name="isJsonDisplayField" title="Json" />   
    <many-to-one name="displayFieldJson" title="Display" ref="com.axelor.meta.db.MetaJsonField" />
    <string name="chartType" selection="studio.chart.builder.chart.type"  default="bar"/>
    <many-to-one name="metaViewGenerated" title="View generated" ref="com.axelor.meta.db.MetaView" />
    <many-to-one name="appBuilder" ref="AppBuilder" title="App builder" />
  </entity>
    
    
 </domain-models>