%mandatory -->  dataSource;
%optional  -->  figureName , xAxisCol , yAxisCol , radiusCol , groupsCol;

function plotDVPScatterPlot( dataSource , figureName , xAxisCol , yAxisCol , radiusCol , groupsCol) 

if nargin < 1
    error('not enough parameters');
end

if ~ischar(dataSource)
        
       if ~isnumeric(dataSource)
          error('invalid dataSoure!'); 
       end
       
     ctr = getappdata(0,'counter');
     dsName = strcat('dataSource ',int2str(ctr+1));
     setappdata(0,'counter',ctr+1);
     createDVPDataSource(dataSource,dsName); 
     
    else
        dsName = dataSource;
end
    

if ~exist('figureName','var')
    
       ctr = getappdata(0,'counter');
    figName = strcat('Scatter',int2str(++ctr));
    
else
        figName = figureName;
end

if ~exist('xAxisCol','var')
    xAxis = 'mat-first-col';
    
else
        xAxis = xAxisCol;
end

if ~exist('yAxisCol','var')
    yAxis = 'mat-second-col';
    
else
        yAxis = yAxisCol;
end

if ~exist('radius','var')
    rad = false;
    
else
        rad = radiusCol;
end

if ~exist('groupsCol','var')
    groups = false;
    
else
        groups = groupsCol;
end

data = struct('requestType', 'create', 'operation', 'figure',...
    'config', struct('figureType', 'Scatterplot', 'id',figName,...
    'dataSourceID', dsName,...
    'figureProperties', struct('xAxis',xAxis , 'yAxis' , yAxis , 'radius' , rad , 'groups' , groups)));

sendDataToDVP(data);
end
